With version 0.0.15 I added initial support for IDNA using ICU under VASmalltalk. Though I added more wrapped API calls in this area, it turned out, that only two calls are mostly needed for daily-work (or at least i assume so).
IDNA helps you to handle domain names with non-ASCII characters like e.g. “www.bücher.de”.
IDNA API’s allows you to convert a domain name with none-ASCII characters into domain names with ASCII characters only, which may then be used for DNS queries.
As an example – there is a domain called “www.bücher.de”.
gives you a new string: ‘www.xn--bcher-kva.de’, which can be used for DNS queries. To get the original URL back you simple execute:
which brings you “www.bücher.de” back (in the current code page of VASmalltalk, here CP-819). Of course by using #idnaNameToCCP I assume, that the original URL can be shown in the current code page. That may not always be possible and therefore you may wish to get a general Unicode based string:
and you get the same result, but now you get an instance of ICUUnicodeString (a new subclass of DBString I introduced with the ICU package) holding Unicode code points. There are also wrapped API calls for UTF8 handling, but I have not tested them yet.
Some new helper methods are also now available – creating DBStrings from an array of code points.
ICUUnicodeString fromCodePoints: #[ 16r0078 16r006E 16r002D 16r002D 16r0062 16r0063 16r0068 16r0065 16r0072 16r002D 16r006B 16r0076 16r0061 ].
which is “www.bücher.de”.