[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: providing a libidn compatibility API
From: |
Tim Rühsen |
Subject: |
Re: providing a libidn compatibility API |
Date: |
Fri, 10 Feb 2017 10:23:29 +0100 |
User-agent: |
KMail/5.2.3 (Linux/4.9.0-1-amd64; KDE/5.28.0; x86_64; ; ) |
On Freitag, 10. Februar 2017 08:32:00 CET Nikos Mavrogiannopoulos wrote:
> On Tue, Feb 7, 2017 at 9:56 PM, Tim Rühsen <address@hidden> 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
signature.asc
Description: This is a digitally signed message part.
- Re: providing a libidn compatibility API, Tim Rühsen, 2017/02/07
- Re: providing a libidn compatibility API, Nikos Mavrogiannopoulos, 2017/02/10
- Re: providing a libidn compatibility API,
Tim Rühsen <=
- Re: providing a libidn compatibility API, Nikos Mavrogiannopoulos, 2017/02/10
- Re: providing a libidn compatibility API, Tim Rühsen, 2017/02/10
- Re: providing a libidn compatibility API, Nikos Mavrogiannopoulos, 2017/02/13
- Re: providing a libidn compatibility API, Nikos Mavrogiannopoulos, 2017/02/14
- Re: providing a libidn compatibility API, Tim Ruehsen, 2017/02/14
- Re: providing a libidn compatibility API, Nikos Mavrogiannopoulos, 2017/02/14
- Re: providing a libidn compatibility API, Simon Josefsson, 2017/02/19