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:
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![]()
a life without programming is like an empty bottle![]()
Maybe you should add a check for if the codec could be found.
In MainWindow::load():
Qt Code:
if (codec) { ui.textEdit->setPlainText(str); }To copy to clipboard, switch view to plain text modeSo I'd suspect the usage of null pointer.. Probably the "other" machine does not have the codec installed?As docs say:
QTextCodec::codecForName() returns 0 if no codec matching the name name could be found.
Last edited by jpn; 29th March 2006 at 10:48.
thanks~~~~~
all is ok~
Bookmarks