X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Futf8.cpp;fp=source%2Futf8.cpp;h=08dd69a664e97dace581bd3324c049217d184a24;hp=2d0458f3254b96c69ff827c0f2e86f5a44ab220b;hb=b11c3af2035f2e91de3a61d8de2de031ee5fb8ab;hpb=e3c7585b472744c6101bb714022f7545bb650493 diff --git a/source/utf8.cpp b/source/utf8.cpp index 2d0458f..08dd69a 100644 --- a/source/utf8.cpp +++ b/source/utf8.cpp @@ -34,7 +34,7 @@ void Utf8::Encoder::encode_char(UnicodeChar ch, string &buf) utf[0]=0xFF<<(8-bytes) | ch>>(bytes*6-6); for(unsigned j=bytes-1; j>0; --j) { - utf[j]=0x80 | ch&0x3F; + utf[j]=0x80 | (ch&0x3F); ch>>=6; } @@ -79,7 +79,7 @@ UnicodeChar Utf8::Decoder::decode_char(const string &str, string::const_iterator i=j; return result; } - result=result<<6 | (*j++)&0x3F; + result=(result<<6) | ((*j++)&0x3F); } if(k