Java Tutorial/I18N/Internationalized Domain Names
IDN.toASCII(String s)
import java.net.IDN;
public class IDNDemo {
public static void main(String[] args) {
String input = "www.yourName.ru";
String ascii = IDN.toASCII(input);
String unicode = IDN.toUnicode(input);
System.out.println("Input:"+ input);
System.out.println("toAscii (input):"+ ascii);
System.out.println("toUnicode (input):"+ unicode);
}
}
IDN.toUnicode(String s)
import java.net.IDN;
public class IDNDemo {
public static void main(String[] args) {
String input = "www.yourName.ru";
String ascii = IDN.toASCII(input);
String unicode = IDN.toUnicode(input);
System.out.println("Input:"+ input);
System.out.println("toAscii (input):"+ ascii);
System.out.println("toUnicode (input):"+ unicode);
}
}
Internationalized Domain Names (IDNs)
import java.net.IDN;
public class IDNDemo {
public static void main(String[] args) {
String input = "www.yourName.ru";
String ascii = IDN.toASCII(input);
String unicode = IDN.toUnicode(input);
System.out.println("Input:"+ input);
System.out.println("toAscii (input):"+ ascii);
System.out.println("toUnicode (input):"+ unicode);
}
}