Results 1 to 3 of 3

Thread: QSettings unicode problem

  1. #1
    Join Date
    Oct 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question QSettings unicode problem

    Hello,

    I want to read settings from an INI file, which is in UTF16-LE format. After reading the docs I thought it is possible by something like this:

    Qt Code:
    1. QSettings settings("test.ini", QSettings::IniFormat);
    2. settings.setIniCodec("UTF-16LE");
    3. settings.value("animal/snake", 1024).toString();
    To copy to clipboard, switch view to plain text mode 

    But when I try to read values, it looks like he is still reading ascii format. Does anyone know what I'm doing wrong or what I'm missing?

  2. #2
    Join Date
    Jul 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSettings unicode problem

    I have the same problem.
    Anyone can help us?

  3. #3
    Join Date
    Sep 2010
    Posts
    13
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSettings unicode problem

    I've noticed this problem, as well, on 4.7.3 SDK. Setting the codec to UTF-16LE results in no values being read properly from the file at all.

    I saved my file as UTF-8 and it started working, reading in my Cyrillic strings properly, however it misread the opening brace of the first section. Putting a blank line in the file above the first section fixed that problem.

    UTF-16 appears to be totally broken, though.

Similar Threads

  1. Unicode Font Display Problem
    By QbelcorT in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd September 2009, 07:11
  2. QSettings problem?
    By cyberboy in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2008, 22:14
  3. QProcess and unicode problem
    By ramazangirgin in forum Qt Programming
    Replies: 0
    Last Post: 6th June 2008, 13:22
  4. QSettings and QGLWidgets
    By Rayven in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2008, 19:01
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.