X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstringcodec%2Fwindows1252.cpp;h=72eb104115db192cce202802d479a4d0e592beff;hb=3e3868860d4f4ca1bbe55fbf271c804307cea3c9;hp=33527e4c92c3fea8df76276a04562f7f9c546450;hpb=967785734be5c3fc6f75da122c2d93ebbb338271;p=libs%2Fcore.git diff --git a/source/stringcodec/windows1252.cpp b/source/stringcodec/windows1252.cpp index 33527e4..72eb104 100644 --- a/source/stringcodec/windows1252.cpp +++ b/source/stringcodec/windows1252.cpp @@ -16,9 +16,9 @@ unsigned short table[32]= namespace Msp { -namespace Codecs { +namespace StringCodec { -void Windows1252::Encoder::encode_char(UnicodeChar ch, string &buf) +void Windows1252::Encoder::encode_char(unichar ch, string &buf) { if((ch>=0 && ch<=0x7F) || (ch>=0xA0 && ch<=0xFF)) buf += ch; @@ -35,19 +35,19 @@ void Windows1252::Encoder::encode_char(UnicodeChar ch, string &buf) } } -void Windows1252::Encoder::transliterate(UnicodeChar, string &buf) +void Windows1252::Encoder::transliterate(unichar, string &buf) { buf += '?'; } -UnicodeChar Windows1252::Decoder::decode_char(const string &str, string::const_iterator &i) +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); - UnicodeChar result; + unichar result; if(ch>=0x80 && ch<=0x9F) { result = table[ch-0x80]; @@ -61,5 +61,5 @@ UnicodeChar Windows1252::Decoder::decode_char(const string &str, string::const_i return result; } -} // namespace Codecs +} // namespace StringCodec } // namespace Msp