X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Funicode.h;h=52ea5e687510c4ad1fdbefe6d602c30d5606a4b6;hb=253697506b3d1752aa233bdca4978dc34243dbf7;hp=12c0fd049de3b3864db69bac92dedffdfb5a6b56;hpb=b35c2205c744eaf557d64280b5fe98c2cb86f4ed;p=libucw.git diff --git a/lib/unicode.h b/lib/unicode.h index 12c0fd04..52ea5e68 100644 --- a/lib/unicode.h +++ b/lib/unicode.h @@ -15,8 +15,8 @@ #define UNI_REPLACEMENT 0xfffc -/* Encode a character from the basic character set [0, 0xFFFF] - * (subset of the formal Unicode range); up to 3 bytes needed (RFC2279) */ +/* Encode a character from the basic multilingual plane [0, 0xFFFF] + * (subset of Unicode 4.0); up to 3 bytes needed (RFC2279) */ static inline byte * utf8_put(byte *p, uns u) { @@ -37,7 +37,8 @@ utf8_put(byte *p, uns u) return p; } -/* Encode a value from the range [0, 0x7FFFFFFF]; up to 6 bytes needed (RFC2279) */ +/* Encode a value from the range [0, 0x7FFFFFFF]; + * (superset of Unicode 4.0) up to 6 bytes needed (RFC2279) */ static inline byte * utf8_32_put(byte *p, uns u) { @@ -79,7 +80,7 @@ put1: *p++ = 0x80 | (u & 0x3f); #define UTF8_GET_NEXT if (unlikely((*p & 0xc0) != 0x80)) goto bad; u = (u << 6) | (*p++ & 0x3f) -/* Decode a character from the basic character set [0, 0xFFFF] +/* Decode a character from the basic multilingual plane [0, 0xFFFF] * or return UNI_REPLACEMENT if the encoding has been corrupted */ static inline byte * utf8_get(const byte *p, uns *uu) @@ -211,6 +212,5 @@ utf8_encoding_len(uns c) uns utf8_strlen(const byte *str); uns utf8_strnlen(const byte *str, uns n); -uns utf8_check(const byte *str); #endif