summaryrefslogtreecommitdiff
path: root/qt/qt-2.3.10.patch/encoding.patch
blob: 13a48282d1f849b29a169da1c18b95fef7e5358b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

#
# Patch managed by http://www.holgerschurig.de/patcher.html
#

--- qt-2.3.9-snapshot-20041211/src/tools/qstring.cpp~encoding
+++ qt-2.3.9-snapshot-20041211/src/tools/qstring.cpp
@@ -14469,7 +14469,11 @@
     return qt_winQString2MB( *this );
 #endif
 #ifdef _WS_QWS_
-    return utf8(); // ##### if there is ANY 8 bit format supported?
+    QTextCodec* codec = QTextCodec::codecForLocale();
+    return codec
+	    ? codec->fromUnicode(*this)
+	    : utf8();
+    //return latin1(); // ##### if there is ANY 8 bit format supported?
 #endif
 #endif
 }
@@ -14515,7 +14519,12 @@
     return qt_winMB2QString( local8Bit );
 #endif
 #ifdef _WS_QWS_
-    return fromUtf8(local8Bit,len);
+    QTextCodec* codec = QTextCodec::codecForLocale();
+    if( len < 0) len = qstrlen(local8Bit);
+    return codec
+	    ? codec->toUnicode(local8Bit, len)
+	    : QString::fromUtf8(local8Bit,len);
+//    return fromLatin1(local8Bit,len);
 #endif
 #endif // QT_NO_TEXTCODEC
 }