On Tue May 27 16:33:14 2014, thozza@redhat.com wrote: > > > - introduce new configure option to turn on the usage of GNU > libidn > > > (something like --with-gnu-libidn) > > > - use libidn2 for IDN -> ACE conversion (as libidn2 suppoerts > IDNA2008 [1] > > > whereas libidn supports only IDNA2003) > > > - use libidn for ACE -> IDN conversion where needed (as libidn2 > apparently > > > does not include support for this) > > > > Pardon my confusion here, but do you mean that two different > versions > > of libidn would be in use at the same time? > > Well I have to admit that I was also little bit confused when looking > at the idnkit > code in dighost.c. > > The process seems to work like this: > 1. the domain name from the CLI is converted to UTF-8 > 2. the origin is converted to UTF-8 > 3. UTF-8 domain name and UTF-8 origin are joined. > 4. the joined domain name is conveted to the translated IDN name (ACE) > > 5. there is output_format() function for converting the translated > IDN ascii (ACE) name to locale when printing it to the CLI. > > Now the "old" a.k.a. IDNA2003 library "libidn" has all the necessary > functions (part of stringprep.h) for conversions of locale <-> UTF-8 > <-> ACE. > > However the libidn2 (IDNA2008) library has only functions for > conversion > of locale -> translated IDN as UTF-8 and UTF-8 -> translated IDN as > UTF-8. > > But I think there is still need for the functions to convert the > translated IDN in UTF-8 > to ACE, locale -> UTF-8 without the IDN translation, ACE -> locale (in > output_filter). > > There is library libunistring that could solve this, but it is also > yet another > library. Looking at the official libidn2 web page[1], it says: "Libidn2 uses GNU libunistring for Unicode processing and GNU libiconv for character set conversion." So it seems that they intend you to use libiconv for converting between the locale and UTF-8. [1] https://www.gnu.org/software/libidn/#libidn2