Results 1 to 3 of 3

Thread: Not existing Shift-JIS codec in QTextCodec

  1. #1
    Join Date
    Sep 2010
    Location
    Zamość, Poland
    Posts
    13
    Thanks
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Symbian S60

    Default Not existing Shift-JIS codec in QTextCodec

    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:
    Qt Code:
    1. QTextCodec *codec = QTextCodec::codecForName("Shift-JIS");
    2. if(codec == 0)
    3. {
    4. qDebug() << tr("There're no Shift-JIS codec");
    5. return;
    6. }
    7. QByteArray tTemp;
    8. // There're writing to tTemp in loop
    9.  
    10. QString temp = codec->toUnicode(tTemp);
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Not existing Shift-JIS codec in QTextCodec

    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?

  3. #3
    Join Date
    Sep 2010
    Location
    Zamość, Poland
    Posts
    13
    Thanks
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Not existing Shift-JIS codec in QTextCodec

    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.

Similar Threads

  1. QIODevice and QTextCodec?
    By whitefurrows in forum Qt Programming
    Replies: 5
    Last Post: 26th November 2010, 18:50
  2. Qt phonon and Codec
    By alexcuiCN in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2010, 08:56
  3. QTextCodec bad encoding?
    By ComaWhite in forum Newbie
    Replies: 0
    Last Post: 18th September 2009, 06:15
  4. Retrieve string codec
    By Raccoon29 in forum Newbie
    Replies: 3
    Last Post: 26th January 2009, 21:21
  5. Using setCodecForCStrings(codec) in Constructor
    By danbetz in forum Qt Programming
    Replies: 5
    Last Post: 30th July 2007, 21:23

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.