mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复PunyCode处理域名的问题
This commit is contained in:
@@ -16,6 +16,14 @@ public class PunyCodeTest {
|
||||
Assert.assertEquals(text, decode);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void encodeDecodeTest2(){
|
||||
// 无需编码和解码
|
||||
String text = "Hutool";
|
||||
String strPunyCode = PunyCode.encode(text);
|
||||
Assert.assertEquals("Hutool", strPunyCode);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void encodeEncodeDomainTest(){
|
||||
String domain = "赵新虎.中国";
|
||||
@@ -23,4 +31,13 @@ public class PunyCodeTest {
|
||||
String decode = PunyCode.decodeDomain(strPunyCode);
|
||||
Assert.assertEquals(decode, domain);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void encodeEncodeDomainTest2(){
|
||||
String domain = "赵新虎.com";
|
||||
String strPunyCode = PunyCode.encodeDomain(domain);
|
||||
Assert.assertEquals("xn--efvz93e52e.com", strPunyCode);
|
||||
String decode = PunyCode.decodeDomain(strPunyCode);
|
||||
Assert.assertEquals(domain, decode);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user