X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstringcodec%2Fwindows1252.cpp;h=a6bde2407bad5cdcb5fa3a2cb458b911b0ebd9b5;hp=531860bca47331a94f2dcae77be1f240573ac209;hb=HEAD;hpb=02794ef3620d0d9cc3b8f1c0d8f2995c825fdf4f diff --git a/source/stringcodec/windows1252.cpp b/source/stringcodec/windows1252.cpp index 531860b..a6bde24 100644 --- a/source/stringcodec/windows1252.cpp +++ b/source/stringcodec/windows1252.cpp @@ -31,7 +31,7 @@ void Windows1252::Encoder::encode_char(unichar ch, string &buf) return; } - error(ch, buf, "Can't express character in Windows-1252"); + error(ch, buf, invalid_character(ch, "Windows-1252")); } } @@ -44,7 +44,7 @@ void Windows1252::Encoder::transliterate(unichar, string &buf) unichar Windows1252::Decoder::decode_char(const string &str, string::const_iterator &i) { if(i==str.end()) - return error("No input"); + return -1; int ch = static_cast(*i); unichar result; @@ -52,7 +52,7 @@ unichar Windows1252::Decoder::decode_char(const string &str, string::const_itera { result = table[ch-0x80]; if(result==0) - result = error("Undefined Windows-1252 character"); + result = error(invalid_sequence(i, i+1, "undefined Windows-1252 character")); } else result = ch;