Hello Nicolas, others, As already said, the answer below is not too helpful. A few more details below: On 2023-02-02 21:43, Nicolas Fiumarelli via UA-EAI wrote:
Offtopic but I found cool stuff in chat GPT regarding IDNA versions. I didn't test it and it also confuses me because there are many cases depending on the context.
Q: why idna2003 and idna2008 are not compatible? Give an example in java
A: IDNA2003 and IDNA2008 are not compatible because they use different algorithms for encoding internationalized domain names (IDNs) into the ASCII-compatible format required by the domain name system (DNS). IDNA2003 uses a simpler, table-based algorithm, while IDNA2008 uses a more complex, context-sensitive algorithm that provides better handling of certain characters and character combinations.
Actually, IDNA2003 and IDNA2008 are mostly compatible, but there are exceptions. Depending on the language(s), scripts, characters, and computer system involved, the difference may be completely ignorable or may be relevant.
Java: import java.net.IDN; public class Main { public static void main(String[] args) { String domainName = "xn--bcher-kva.example";
// IDNA2003 String idna2003 = IDN.toASCII(domainName, IDN.ALLOW_UNASSIGNED); System.out.println("IDNA2003: " + idna2003);
// IDNA2008 String idna2008 = IDN.toASCII(domainName, IDN.USE_STD3_ASCII_RULES | IDN.ALLOW_UNASSIGNED); System.out.println("IDNA2008: " + idna2008); } } Output: IDNA2003: bücher.example IDNA2008: xn--bcher-kva.example
In this example, the domain name "bücher.example" is encoded using both IDNA2003 and IDNA2008, and the resulting ASCII-compatible strings are printed to the console. The IDNA2003 encoding results in "bücher.example", which may not be acceptable for use as a domain name in the DNS, while the IDNA2008 encoding results in "xn--bcher-kva.example", which is a valid ASCII-compatible string.
According to the latest official documentation at https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/net/IDN.ht..., JAVA still seems to be on IDNA2003, without support for IDNA2008. That can be deduced from the fact that it references nothing newer than RFC 3490. But wherever the above example program was run, there was either a faulty implementation involved, or somehow the output came from somewhere else (we don't know what parts of the answer came from where). There's *no way* the string idna2008 should end up as bücher.example after applying the toASCII method. Regards, Martin.
......
Regards, Nicolas.