X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstringcodec%2Fcodec.cpp;h=a342242402beaf65b8aafb4e9eee29b0af20550d;hb=9a79b9ca04d934e8e5b865a1d2b6719f76ec9d15;hp=a7127205db3c5118aea20c27a8748ff82ebb461f;hpb=967785734be5c3fc6f75da122c2d93ebbb338271;p=libs%2Fcore.git diff --git a/source/stringcodec/codec.cpp b/source/stringcodec/codec.cpp index a712720..a342242 100644 --- a/source/stringcodec/codec.cpp +++ b/source/stringcodec/codec.cpp @@ -12,7 +12,7 @@ using namespace std; namespace Msp { -namespace Codecs { +namespace StringCodec { bool Codec::detect(const string &str) const { @@ -47,7 +47,7 @@ string Codec::Encoder::encode(const ustring &str) return buf; } -void Codec::Encoder::error(UnicodeChar ch, string &buf, const string &msg) +void Codec::Encoder::error(unichar ch, string &buf, const string &msg) { switch(err_mode) { @@ -65,7 +65,7 @@ void Codec::Decoder::decode(const string &str, ustring &buf) { for(string::const_iterator i=str.begin(); i!=str.end();) { - UnicodeChar c = decode_char(str, i); + unichar c = decode_char(str, i); if(c!=-1) buf += c; } @@ -78,12 +78,12 @@ ustring Codec::Decoder::decode(const string &str) return buf; } -UnicodeChar Codec::Decoder::error(const string &msg) +unichar Codec::Decoder::error(const string &msg) { switch(err_mode) { case TRANSLITERATE: - return 0xFFFE; + return 0xFFFD; case IGNORE_ERRORS: return -1; default: @@ -166,5 +166,5 @@ Codec *detect_codec(const string &str) return new Windows1252; } -} // namespace Codecs +} // namespace StringCodec } // namespace Msp