Logo Search packages:      
Sourcecode: icu version File versions  Download package

uidna.h File Reference


Detailed Description

C API: Internationalized Domain Names in Applications Tranformation.

UIDNA API implements the IDNA protocol as defined in the IDNA RFC (http://www.ietf.org/rfc/rfc3490.txt). The RFC defines 2 operations: ToASCII and ToUnicode. Domain labels containing non-ASCII code points are required to be processed by ToASCII operation before passing it to resolver libraries. Domain names that are obtained from resolver libraries are required to be processed by ToUnicode operation before displaying the domain name to the user. IDNA requires that implementations process input strings with Nameprep (http://www.ietf.org/rfc/rfc3491.txt), which is a profile of Stringprep (http://www.ietf.org/rfc/rfc3454.txt), and then with Punycode (http://www.ietf.org/rfc/rfc3492.txt). Implementations of IDNA MUST fully implement Nameprep and Punycode; neither Nameprep nor Punycode are optional. The input and output of ToASCII and ToUnicode operations are Unicode and are designed to be chainable, i.e., applying ToASCII or ToUnicode operations multiple times to an input string will yield the same result as applying the operation once. ToUnicode(ToUnicode(ToUnicode...(ToUnicode(string)))) == ToUnicode(string) ToASCII(ToASCII(ToASCII...(ToASCII(string))) == ToASCII(string).

Definition in file uidna.h.

#include "unicode/utypes.h"
#include "unicode/parseerr.h"

Go to the source code of this file.

Defines

#define UIDNA_ALLOW_UNASSIGNED   0x0001
#define UIDNA_DEFAULT   0x0000
#define UIDNA_USE_STD3_RULES   0x0002

Functions

U_STABLE int32_t U_EXPORT2 uidna_compare (const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, int32_t options, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 uidna_IDNToASCII (const UChar *src, int32_t srcLength, UChar *dest, int32_t destCapacity, int32_t options, UParseError *parseError, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 uidna_IDNToUnicode (const UChar *src, int32_t srcLength, UChar *dest, int32_t destCapacity, int32_t options, UParseError *parseError, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 uidna_toASCII (const UChar *src, int32_t srcLength, UChar *dest, int32_t destCapacity, int32_t options, UParseError *parseError, UErrorCode *status)
U_STABLE int32_t U_EXPORT2 uidna_toUnicode (const UChar *src, int32_t srcLength, UChar *dest, int32_t destCapacity, int32_t options, UParseError *parseError, UErrorCode *status)


Generated by  Doxygen 1.6.0   Back to index