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=4c75d8b073e277c2adc2f38db5f3db806da7b0e5;hp=19fe488282561dafbe1d4b788ec3bee0b8cb1b18;hb=9a79b9ca04d934e8e5b865a1d2b6719f76ec9d15;hpb=c5cb2162baeeb7c750595e07ba1cbfcb03702f77 diff --git a/source/stringcodec/utf8.cpp b/source/stringcodec/utf8.cpp index 19fe488..4c75d8b 100644 --- a/source/stringcodec/utf8.cpp +++ b/source/stringcodec/utf8.cpp @@ -71,7 +71,7 @@ unichar Utf8::Decoder::decode_char(const string &str, string::const_iterator &i) result = error("Incomplete UTF-8 character"); else if(!(result>>(bytes*5-4)) || !(result>>7)) result = error("Denormalized UTF-8 multibyte sequence"); - else if(result>0x10FFFF || (result>=0xD800 && result<=0xDFFF)) + else if(!is_valid_unichar(result)) result = error("Invalid Unicode code point"); i = j;