diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-11-22 02:39:43 +0200 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-11-22 02:39:43 +0200 |
commit | baba7489c48a759bdf6479e718a28f1339aaac54 (patch) | |
tree | 92c105e7376470f2ac929cd35c80609b22d5c36d /core | |
parent | a68c467f845c44faff44f045dd64768d2d80eb97 (diff) |
modified: core/utf8.cpp
Diffstat (limited to 'core')
-rw-r--r-- | core/utf8.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/utf8.cpp b/core/utf8.cpp index 7425af0..7b091a8 100644 --- a/core/utf8.cpp +++ b/core/utf8.cpp @@ -20,7 +20,9 @@ std::string toUTF8(std::wstring str) { std::string ustr; - utf8::utf16to8(str.begin(), str.end(), back_inserter(ustr)); + std::wstring tmpstr; + utf8::replace_invalid(str.begin(), str.end(), back_inserter(tmpstr)); + utf8::utf16to8(tmpstr.begin(), tmpstr.end(), back_inserter(ustr)); return ustr; } |