402 if(
tld_byte_out(s, max_length, (
char) ((wc >> 6) | 0xC0)) != 0)
406 return tld_byte_out(s, max_length, (
char) ((wc & 0x3F) | 0x80));
410 if((wc >= 0xD800 && wc <= 0xDFFF)
417 if(
tld_byte_out(s, max_length, (
char) ((wc >> 12) | 0xE0)) != 0)
421 if(
tld_byte_out(s, max_length, (
char) (((wc >> 6) & 0x3F) | 0x80)) != 0)
425 return tld_byte_out(s, max_length, (
char) ((wc & 0x3F) | 0x80));
429 if((wc & 0xFFFF) == 0xFFFE
430 || (wc & 0xFFFF) == 0xFFFF)
435 if(
tld_byte_out(s, max_length, (
char) ((wc >> 18) | 0xF0)) != 0)
439 if(
tld_byte_out(s, max_length, (
char) (((wc >> 12) & 0x3F) | 0x80)) != 0)
443 if(
tld_byte_out(s, max_length, (
char) (((wc >> 6) & 0x3F) | 0x80)) != 0)
447 return tld_byte_out(s, max_length, (
char) ((wc & 0x3F) | 0x80));
static int tld_dec2hex(int d)
Transform a number to a hexadecimal digit.
static int tld_wctomb(wint_t wc, char **s, int *max_length)
Convert a wide character to UTF-8.
static int tld_byte_in(const char **s)
Read one byte of data.
char * tld_domain_to_lowercase(const char *domain)
Transform a domain with a TLD to lowercase before processing.
static int tld_hex2dec(char c)
Transform a hexadecimal digit to a number.
static int tld_byte_out(char **s, int *max_length, char byte)
The tld_byte_out() outputs a character.
static wint_t tld_mbtowc(const char **s)
Transform a multi-byte UTF-8 character to a wide character.