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

QLocale/Win is doing too many locale name conversions

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.0.0, 6.11
    • Core: Locales (i18n)
    • None
    • 3

      The code is converting between encodings back and forth. It's e.g. using QString::fromUtf8(QLocalePrivate::bcp47Name()) instead of QLocale::bcpName(), which internally already does the faster fromLatin1(), and centralized at that.

      Further, all users of getWinLocaleName() do an immediate fromLatin1() on its result, but the function itself ends with a call to QString::toLatin1(). Granted, there's also a code path in that function that works on QByteArray. But said QByteArray comes from qgetenv() and there's qEnvironmentVariable() (and it is my understanding that on Windows that one is preferable because the environment is in UTF-16 already).

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cnn Qt Core & Network
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes