summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-11-22 02:39:43 +0200
committerGluzskiy Alexandr <sss123next@list.ru>2010-11-22 02:39:43 +0200
commitbaba7489c48a759bdf6479e718a28f1339aaac54 (patch)
tree92c105e7376470f2ac929cd35c80609b22d5c36d
parenta68c467f845c44faff44f045dd64768d2d80eb97 (diff)
modified: core/utf8.cpp
-rw-r--r--core/utf8.cpp4
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;
}