Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Decode chinese issue by QSettings to read ini file.
Forum Updated to NodeBB v4.3 + New Features

Decode chinese issue by QSettings to read ini file.

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 918 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    songzhao831
    wrote on last edited by
    #1

    Hi.

    I meet a chinese read/write issue on QT5.2.1, it very strange, the code like this.

    @
    QSettings *ConfigIni_write = new QSettings("./config.ini",QSettings::IniFormat,0);
    ConfigIni_write->setIniCodec("UTF-8");
    ui->v_bggdh->setText(ConfigIni_write->value("/basicinfo/v_bggdh").toString()); //display chinese is a mess here.
    ..........
    ConfigIni_write->setValue("/basicinfo/v_dz",ui->address->text());//write chinese is OK here.
    @

    I already set UTF-8 codec, but the strange thing is when i write it, and read again, diaplay in editline is OK.
    BUT, relauch Application again, found the editline display mess again.

    In a words, in this application, write/read is OK, launch application again, chinese display is a mess.

    [edit: added missing coding tags @ SGaist]

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved