On Freitag, 10. Februar 2017 08:32:00 CET Nikos Mavrogiannopoulos wrote:
> On Tue, Feb 7, 2017 at 9:56 PM, Tim Rühsen <tim.rueh...@gmx.de> wrote:
> >> Great work. The current decode branch seems very good. Do you plan to
> >> add the idna_to_ascii functions as well?
> > 
> > Just pushed the first untested code (branch 'decode').
> > Needs
> > - test code
> > - docs (also the libidn unicode functions are still missing documentation)
> 
> What about this documentation and semantic change. That is, the flags
> parameter is ignored for these functions (to make sure that libidn1
> flags don't result to unintentional side-effects).

Thanks for the docs !
idn2_to_ascii_4i has different argument names than the docs - IMO, we should 
amend the arg names of the function to be in sync with the other to_ascii 
functions.

Regarding the flags, I made a different approach yesterday (see 'decode' 
branch, commit 1992f3b171945677d5445f7c91a83d4746aefa04).

That is, defining (resp. enum'ing)
+    IDN2_ALLOW_UNASSIGNED = 16,
+    IDN2_USE_STD3_ASCII_RULES = 32

and in the compat code
+    IDNA_ALLOW_UNASSIGNED = IDN2_ALLOW_UNASSIGNED,
+    IDNA_USE_STD3_ASCII_RULES = IDN2_USE_STD3_ASCII_RULES

And I changed the defines to
+  #define idna_to_ascii_4i(i,l,o,f)  idn2_to_ascii_4i(i,l,o,f|IDN2_NFC_INPUT|
IDN2_NONTRANSITIONAL)
+  #define idna_to_ascii_4z(i,o,f)  idn2_to_ascii_4z(i,o,f|IDN2_NFC_INPUT|
IDN2_NONTRANSITIONAL)
+  #define idna_to_ascii_8z(i,o,f)  idn2_to_ascii_8z(i,o,f|IDN2_NFC_INPUT|
IDN2_NONTRANSITIONAL)
+  #define idna_to_ascii_lz(i,o,f)  idn2_to_ascii_lz(i,o,f|IDN2_NFC_INPUT|
IDN2_NONTRANSITIONAL)

The advantage would be to not hard-code flags within idn2_to_ascii_*(). That 
seems to be more flexible. If you agree, I'll commit the docs from your patch 
and amend the arg names of idn2_to_ascii_4i.

Regards, Tim

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Help-libidn mailing list
Help-libidn@gnu.org
https://lists.gnu.org/mailman/listinfo/help-libidn

Reply via email to