// unicode.h - Don Yang (uguu.org) // // 06/22/11 #ifndef UNICODE_H_ #define UNICODE_H_ #include #include #include using namespace std; // Parse a UTF-8 character. Returns unicode value on success, or // 0xFFFD (Unicode replacement character) on error. Iterator is // always updated to point at the last byte on return. // // Iterator must point at a UTF-8 character on input. unsigned int ParseUtf8Char(const string &input, string::const_iterator *i); // Advance an iterator to the next character. Iterator may point at // an ASCII or UTF-8 character on input. If there aren't enough // characters left, iterator will point at end(). void NextChar(string *input, string::iterator *i); #endif // UNICODE_H_