Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-99401

QSettings: support reading UTF-8 keys from INI files

XMLWordPrintable

    • Linux/X11, macOS
    • 8
    • Team One Foundation Sprint 52, Team A Foundation Sprint 53

      Ini files with unicode characters like German umlauts are not read correctly and saving stores in ASCII. SetIniCodec() was removed and according the documentation it should be UTF8 by default now. Same problem exists on macOS.

      #include <QCoreApplication>
       #include <QSettings>
      int main(int argc, char *argv[])
      { QCoreApplication a(argc, argv); QSettings settings("test.ini", QSettings::IniFormat); settings.beginGroup("Test"); settings.setValue("BAR",""); settings.setValue("BÄR",""); settings.setValue("OST",""); settings.setValue("ÖSE",""); settings.endGroup(); return a.exec(); }

      >file test.ini
      test.ini: ASCII text

      [Test]
      BAR=
      B%C4R=
      OST=
      %D6SE=

      Update: the scope of this task is changed to implement only reading support, because writing is not backward-compatible. QTBUG-101380 is created to track the writing support, which might happen in next major release.

        For Gerrit Dashboard: QTBUG-99401
        # Subject Branch Project Status CR V

            ivan.solovev Ivan Solovev
            htietze Heiko Tietze
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes