PDA

View Full Version : Not existing Shift-JIS codec in QTextCodec



Sölve
7th June 2011, 14:00
Hello.
During program writing I met problem with QTextCodec.
I want to decode text from Shift-JIS.

I've got two computers, at first I've got linux and Win 7 x64, at second Win XP.
On linux and Win 7 with installed Qt4 (4.7.0) decoding is successful, but on Win XP (Qt4 is not installed) not.
When I creating QTextCodec 0 is returned and I can't decode text.
On XP I've got installed east-asian languages support.
How can I get QTextCodec working?
Thanks in advance.

Some piece of my code:

QTextCodec *codec = QTextCodec::codecForName("Shift-JIS");
if(codec == 0)
{
qDebug() << tr("There're no Shift-JIS codec");
return;
}
QByteArray tTemp;
// There're writing to tTemp in loop

QString temp = codec->toUnicode(tTemp);

Santosh Reddy
8th June 2011, 02:18
Not sure what could be the problem, just to make sure it has nothing do with 64 bit / 32 bits platforms

Is your Win XP 32 bit / 64 bit?

If 32-bit, you should have built on a 32-bit machine which has Qt, does our app work there?

Did any of the other functionality does not work, other than QTextCodec?

Sölve
8th June 2011, 14:48
Hi.
Thanks for reply.
Win XP 32 bit.
I discovered that I hadn't copied codecs dlls to application_folder/plugins/codecs. Now application running well.
Thanks, problem solved.