diff options
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index fea96a7..985889c 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -274,7 +274,7 @@ static bool splitLocaleName(const QString &name, QChar *lang_begin, QChar *cntry switch (state) { case 0: // parsing language - if (uc->unicode() == '_') { + if (uc->unicode() == '_' || uc->unicode() == '-') { state = 1; break; } @@ -2360,7 +2360,7 @@ static quint16 localePrivateIndex(const QLocalePrivate *p) /*! Constructs a QLocale object with the specified \a name, which has the format - "language[_country][.codeset][@modifier]" or "C", where: + "language[_-country][.codeset][@modifier]" or "C", where: \list \i language is a lowercase, two-letter, ISO 639 language code, @@ -2368,6 +2368,8 @@ static quint16 localePrivateIndex(const QLocalePrivate *p) \i and codeset and modifier are ignored. \endlist + The separator can be either underscore or a minus sign. + If the string violates the locale format, or language is not a valid ISO 369 code, the "C" locale is used instead. If country is not present, or is not a valid ISO 3166 code, the most |