blob: f1c839d7928a0848adb323be7777a065d27ff1a5 (
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
|
//! [0]
encodedString = QByteArray("...")
codec = QTextCodec::codecForName("KOI8-R")
string = codec->toUnicode(encodedString)
//! [0]
//! [1]
string = QString("...")
codec = QTextCodec::codecForName("KOI8-R")
encodedString = codec->fromUnicode(string)
//! [1]
//! [2]
codec = QTextCodec::codecForName("Shift-JIS")
decoder = codec->makeDecoder()
string = QString()
while new_data_available():
chunk = get_new_data();
string += decoder->toUnicode(chunk)
//! [2]
//! [3]
def main():
app = QApplication([])
QTextCodec::setCodecForTr(QTextCodec::codecForName("eucKR"))
...
//! [3]
|