Example #1
0
 @Test
 public void testToASCII() throws Exception {
   assertEquals("http://www.xn--evir-zoa.com", URLUtil.toASCII("http://www.çevir.com"));
   assertEquals("http://xn--uni-tbingen-xhb.de/", URLUtil.toASCII("http://uni-tübingen.de/"));
   assertEquals(
       "http://www.medizin.xn--uni-tbingen-xhb.de:8080/search.php?q=abc#p1",
       URLUtil.toASCII("http://www.medizin.uni-tübingen.de:8080/search.php?q=abc#p1"));
 }
Example #2
0
 @Test
 public void testFileProtocol() throws Exception {
   // keep one single slash NUTCH-XXX
   assertEquals("file:/path/file.html", URLUtil.toASCII("file:/path/file.html"));
   assertEquals("file:/path/file.html", URLUtil.toUNICODE("file:/path/file.html"));
 }