my application is crashing when i use QTextCodec class to decode chinese GB2312 text on other computer without Qt, but run on my machine is well. why?
help me~
Paltform: winxp
Qt: 4.1.1 open source
Code below:
Printable View
my application is crashing when i use QTextCodec class to decode chinese GB2312 text on other computer without Qt, but run on my machine is well. why?
help me~
Paltform: winxp
Qt: 4.1.1 open source
Code below:
Maiby another win open source bug :confused:
Maybe you should add a check for if the codec could be found.
In MainWindow::load():
Code:
if (codec) { ui.textEdit->setPlainText(str); }
So I'd suspect the usage of null pointer.. Probably the "other" machine does not have the codec installed?Quote:
As docs say:
QTextCodec::codecForName() returns 0 if no codec matching the name name could be found.
thanks~~~~~
all is ok~