|
Squid Web Cache v8/master
|
Go to the source code of this file.
Functions | |
| SBuf | Latin1ToUtf8 (const char *in) |
| converts ISO-LATIN-1 to UTF-8 | |
| SBuf | Cp1251ToUtf8 (const char *in) |
| converts CP1251 to UTF-8 | |
| static size_t | utf8CodePointLength (const char b0) |
| static bool | isValidUtf8CodePoint (const unsigned char *source, const size_t length) |
| bool | isValidUtf8String (const char *source, const char *sourceEnd) |
| returns whether the given input is a valid (or empty) sequence of UTF-8 code points | |
| SBuf Cp1251ToUtf8 | ( | const char * | in | ) |
Definition at line 37 of file toUtf.cc.
References SBuf::append().
|
static |
Utility routine to tell whether a sequence of bytes is valid UTF-8. This must be called with the length pre-determined by the first byte. If presented with a length > 4, this returns false. The Unicode definition of UTF-8 goes up to 4-byte code points.
Definition at line 123 of file toUtf.cc.
Referenced by isValidUtf8String().
| bool isValidUtf8String | ( | const char * | source, |
| const char * | sourceEnd | ||
| ) |
Definition at line 172 of file toUtf.cc.
References isValidUtf8CodePoint(), and utf8CodePointLength().
| SBuf Latin1ToUtf8 | ( | const char * | in | ) |
Definition at line 16 of file toUtf.cc.
References SBuf::append().
|
inlinestatic |
| 0 | indicates an invalid code point |
| b0 | the first byte of a UTF-8 code point |
Definition at line 101 of file toUtf.cc.
Referenced by isValidUtf8String().