X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstringcodec%2Futf8.cpp;fp=source%2Fstringcodec%2Futf8.cpp;h=f56ba546064ee0c234f8d47af5a2d4fc25d0fb04;hp=4d3cea50dab27d33fc8030b18e484c0e620466dc;hb=02794ef3620d0d9cc3b8f1c0d8f2995c825fdf4f;hpb=b011b17393069d86790b2291a759280e15c75a0f diff --git a/source/stringcodec/utf8.cpp b/source/stringcodec/utf8.cpp index 4d3cea5..f56ba54 100644 --- a/source/stringcodec/utf8.cpp +++ b/source/stringcodec/utf8.cpp @@ -5,7 +5,7 @@ using namespace std; namespace Msp { namespace StringCodec { -void Utf8::Encoder::encode_char(UnicodeChar ch, string &buf) +void Utf8::Encoder::encode_char(unichar ch, string &buf) { if(ch<0 || ch>0x10FFFF) return error(ch, buf, "Can't express character in UTF-8"); @@ -35,20 +35,20 @@ void Utf8::Encoder::encode_char(UnicodeChar ch, string &buf) } } -void Utf8::Encoder::transliterate(UnicodeChar, string &buf) +void Utf8::Encoder::transliterate(unichar, string &buf) { buf.append("\357\277\275", 3); // � U+FFFE Replacement Character } -UnicodeChar Utf8::Decoder::decode_char(const string &str, string::const_iterator &i) +unichar Utf8::Decoder::decode_char(const string &str, string::const_iterator &i) { if(i==str.end()) return error("No input"); if((*i&0xC0)==0x80) { - UnicodeChar result = error("UTF-8 tail byte found when expecting head"); + unichar result = error("UTF-8 tail byte found when expecting head"); ++i; return result; } @@ -61,7 +61,7 @@ UnicodeChar Utf8::Decoder::decode_char(const string &str, string::const_iterator string::const_iterator j = i; - UnicodeChar result = (*j++)&(mask-1); + unichar result = (*j++)&(mask-1); unsigned k; for(k=1; (k