From eaa62e69a0d579f968f355792477f708783642dd Mon Sep 17 00:00:00 2001 From: Abs62 Date: Thu, 19 Jul 2012 16:53:15 +0400 Subject: [PATCH] Win-specific: Workaround for CJK Extension B characters handling in QString::toUcs4(). Fix issue #107. --- wstring_qt.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wstring_qt.cc b/wstring_qt.cc index 47ede4ab..110989d2 100644 --- a/wstring_qt.cc +++ b/wstring_qt.cc @@ -14,6 +14,12 @@ namespace gd { QVector< unsigned int > v = in.toUcs4(); + // Fix for CJK Extension B characters + int n = v.size(); + while( n > 0 && v[ n - 1 ] == 0 ) n--; + if( n != v.size() ) + v.resize( n ); + return wstring( v.constData(), v.size() ); }