X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fstringcodec%2Fcodec.cpp;fp=source%2Fstringcodec%2Fcodec.cpp;h=b1c05c50292295e573f307497a175ac78797a08a;hb=94ee3a1040f67d9de2e92fc34049642b08d65b3e;hp=3dc4f9a9d452efe7aef2478878d36ad3977af170;hpb=93bb92bad766d269a6bac87e00020a6158531739;p=libs%2Fcore.git diff --git a/source/stringcodec/codec.cpp b/source/stringcodec/codec.cpp index 3dc4f9a..b1c05c5 100644 --- a/source/stringcodec/codec.cpp +++ b/source/stringcodec/codec.cpp @@ -41,18 +41,6 @@ string Codec::Encoder::encode(const ustring &str) return buf; } -void Codec::Encoder::error(unichar ch, string &buf, const string &msg) -{ - switch(err_mode) - { - case TRANSLITERATE: - transliterate(ch, buf); - case IGNORE_ERRORS: - break; - default: - throw CodecError(msg); - } -} void Codec::Decoder::decode(const string &str, ustring &buf) @@ -72,19 +60,6 @@ ustring Codec::Decoder::decode(const string &str) return buf; } -unichar Codec::Decoder::error(const string &msg) -{ - switch(err_mode) - { - case TRANSLITERATE: - return 0xFFFD; - case IGNORE_ERRORS: - return -1; - default: - throw CodecError(msg); - } -} - Codec *create_codec(const string &n) { string name; @@ -105,7 +80,7 @@ Codec *create_codec(const string &n) if(name=="jisx0208") return new JisX0208; if(name=="utf8") return new Utf8; if(name=="windows1252" || name=="cp1252") return new Windows1252; - throw InvalidParameterValue("Unknown string codec"); + throw invalid_argument("unknown string codec"); } Codec *detect_codec(const string &str)