mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
try IANA match in nameMatch()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
ba85709643
commit
7bb93bc715
1 changed files with 9 additions and 1 deletions
|
@ -47,7 +47,15 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
static inline bool nameMatch(const QByteArray &name, const QByteArray &name2)
|
||||
{
|
||||
return (ucnv_compareNames(name.constData(), name2.constData()) == 0);
|
||||
if (ucnv_compareNames(name.constData(), name2.constData()) == 0) {
|
||||
return true;
|
||||
}
|
||||
UErrorCode error = U_ZERO_ERROR;
|
||||
const char *iana = ucnv_getStandardName(name.constData(), "IANA", &error);
|
||||
if (Q_UNLIKELY(U_FAILURE(error) || !iana)) {
|
||||
return false;
|
||||
}
|
||||
return (ucnv_compareNames(iana, name2.constData()) == 0);
|
||||
}
|
||||
|
||||
static QTextCodec *localeMapper = Q_NULLPTR;
|
||||
|
|
Loading…
Add table
Reference in a new issue