From: Mikko Rasa Date: Sun, 5 Jun 2011 19:52:42 +0000 (+0300) Subject: Fix unicode replacement character X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=c5cb2162baeeb7c750595e07ba1cbfcb03702f77 Fix unicode replacement character --- diff --git a/source/stringcodec/codec.cpp b/source/stringcodec/codec.cpp index b7c600d..a342242 100644 --- a/source/stringcodec/codec.cpp +++ b/source/stringcodec/codec.cpp @@ -83,7 +83,7 @@ unichar Codec::Decoder::error(const string &msg) switch(err_mode) { case TRANSLITERATE: - return 0xFFFE; + return 0xFFFD; case IGNORE_ERRORS: return -1; default: diff --git a/source/stringcodec/codec.h b/source/stringcodec/codec.h index eec1e4b..cb80066 100644 --- a/source/stringcodec/codec.h +++ b/source/stringcodec/codec.h @@ -121,7 +121,7 @@ public: THROW_ON_ERROR: throws CodecError(msg) IGNORE_ERRORS: returns -1 - TRANSLITERATE: return 0xFFFE */ + TRANSLITERATE: return 0xFFFD */ unichar error(const std::string &msg); }; diff --git a/source/stringcodec/utf8.cpp b/source/stringcodec/utf8.cpp index b0431eb..19fe488 100644 --- a/source/stringcodec/utf8.cpp +++ b/source/stringcodec/utf8.cpp @@ -37,7 +37,7 @@ void Utf8::Encoder::encode_char(unichar ch, string &buf) void Utf8::Encoder::transliterate(unichar, string &buf) { - buf.append("\357\277\275", 3); // � U+FFFE Replacement Character + buf.append("\357\277\275", 3); // � U+FFFD Replacement Character }