Watt-32 tcp/ip  2.2 dev-rel.10
Data Structures | Typedefs | Functions
idna.h File Reference

Go to the source code of this file.

Data Structures

struct  conv_t
 
struct  Summary16
 

Typedefs

typedef long ucs4_t
 

Functions

const char * iconv_strerror (int rc)
 Return textual error for 'rc'.
 
BOOL iconv_init (WORD code_page)
 Initialise iconv; find codepage and mapping functions to use.
 
BOOL IDNA_convert_to_ACE (char *name, size_t *size)
 Convert a possibly non-ASCII name into ACE-form. More...
 
BOOL IDNA_convert_from_ACE (char *name, size_t *size)
 Convert a possibly ACE-encoded name to a name in native codepage. More...
 

Function Documentation

BOOL IDNA_convert_from_ACE ( char *  name,
size_t *  size 
)

Convert a possibly ACE-encoded name to a name in native codepage.

Todo:
Check for over-run on output.

1) Pass through labels w/o "xn--" prefix unaltered. 2) Strip "xn--" prefix and pass to punycode_decode() 3) Repeat for all labels with "xn--" prefix. 4) Collect Unicode strings and convert to original codepage.

Definition at line 451 of file idna.c.

BOOL IDNA_convert_to_ACE ( char *  name,
size_t *  size 
)

Convert a possibly non-ASCII name into ACE-form.

E.g. convert "www.troms›.no" to ACE:

1) Convert each label separately; "www", "troms›" and "no" 2) "troms›" -> u+0074 u+0072 u+006F u+006D u+0073 u+00F8 3) Pass this through `punycode_encode()' which gives "troms-zua". 4) Repeat for all labels with non-ASCII letters. 5) Prepending "xn--" for each converted label gives "www.xn--troms-zua.no".

E.g. 2: "bl†b‘r.syltet›y.no" -> "xn--blbr-roah.xn--syltety-v1a.no"

Ref. http://www.imc.org/idna/do-idna.cgi http://www.norid.no/domenenavnbaser/ace/ace_technical.en.html

Definition at line 384 of file idna.c.