X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstringcodec%2Fiso88591.cpp;h=a21b6f15d6601e04be4cbeb7100218a5308cc90b;hp=a5f3c55bb402a57348372644911f27cf50e7ae42;hb=242a4a9abe1e1113b5eb39aa751aa054f696d7be;hpb=967785734be5c3fc6f75da122c2d93ebbb338271 diff --git a/source/stringcodec/iso88591.cpp b/source/stringcodec/iso88591.cpp index a5f3c55..a21b6f1 100644 --- a/source/stringcodec/iso88591.cpp +++ b/source/stringcodec/iso88591.cpp @@ -3,29 +3,29 @@ using namespace std; namespace Msp { -namespace Codecs { +namespace StringCodec { -void Iso88591::Encoder::encode_char(UnicodeChar ch, string &buf) +void Iso88591::Encoder::encode_char(unichar ch, string &buf) { if(ch<0 || ch>0xFF) - return error(ch, buf, "Can't express character in ISO-8859-1"); + return error(ch, buf, invalid_character(ch, "ISO-8859-1")); buf += ch; } -void Iso88591::Encoder::transliterate(UnicodeChar, string &buf) +void Iso88591::Encoder::transliterate(unichar, string &buf) { buf += '?'; } -UnicodeChar Iso88591::Decoder::decode_char(const string &str, string::const_iterator &i) +unichar Iso88591::Decoder::decode_char(const string &str, string::const_iterator &i) { if(i==str.end()) - return error("No input"); + return -1; return static_cast(*i++); } -} // namespace Codecs +} // namespace StringCodec } // namespace Msp