Diffstat (limited to 'qt/qt-2.3.10.patch/encoding.patch') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qt/qt-2.3.10.patch/encoding.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qt/qt-2.3.10.patch/encoding.patch b/qt/qt-2.3.10.patch/encoding.patch new file mode 100644 index 0000000..13a4828 --- a/dev/null +++ b/qt/qt-2.3.10.patch/encoding.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | |||
2 | # | ||
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
4 | # | ||
5 | |||
6 | --- qt-2.3.9-snapshot-20041211/src/tools/qstring.cpp~encoding | ||
7 | +++ qt-2.3.9-snapshot-20041211/src/tools/qstring.cpp | ||
8 | @@ -14469,7 +14469,11 @@ | ||
9 | return qt_winQString2MB( *this ); | ||
10 | #endif | ||
11 | #ifdef _WS_QWS_ | ||
12 | - return utf8(); // ##### if there is ANY 8 bit format supported? | ||
13 | + QTextCodec* codec = QTextCodec::codecForLocale(); | ||
14 | + return codec | ||
15 | + ? codec->fromUnicode(*this) | ||
16 | + : utf8(); | ||
17 | + //return latin1(); // ##### if there is ANY 8 bit format supported? | ||
18 | #endif | ||
19 | #endif | ||
20 | } | ||
21 | @@ -14515,7 +14519,12 @@ | ||
22 | return qt_winMB2QString( local8Bit ); | ||
23 | #endif | ||
24 | #ifdef _WS_QWS_ | ||
25 | - return fromUtf8(local8Bit,len); | ||
26 | + QTextCodec* codec = QTextCodec::codecForLocale(); | ||
27 | + if( len < 0) len = qstrlen(local8Bit); | ||
28 | + return codec | ||
29 | + ? codec->toUnicode(local8Bit, len) | ||
30 | + : QString::fromUtf8(local8Bit,len); | ||
31 | +// return fromLatin1(local8Bit,len); | ||
32 | #endif | ||
33 | #endif // QT_NO_TEXTCODEC | ||
34 | } | ||