X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstringcodec%2Fiso88591.cpp;h=a21b6f15d6601e04be4cbeb7100218a5308cc90b;hb=99b9121e2158603372c7313400283b622e6754d8;hp=064d4a76792eae33f12ee45a802187fc66a56750;hpb=b56eb5ec1da675da0c66abc53c1e4f6c4e4cccbd;p=libs%2Fcore.git diff --git a/source/stringcodec/iso88591.cpp b/source/stringcodec/iso88591.cpp index 064d4a7..a21b6f1 100644 --- a/source/stringcodec/iso88591.cpp +++ b/source/stringcodec/iso88591.cpp @@ -1,38 +1,31 @@ -/* $Id$ - -This file is part of libmspstrings -Copyright © 2006-2007 Mikko Rasa -Distributed under the LGPL -*/ - #include "iso88591.h" 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