Fix locale filtering for UTF-8 on Fedora.
locale -a returns the locales using ".utf8" names rather than ".UTF-8". The case-insensitive match does not help because it is "utf8" rather than "UTF-8". So we need to match both with and without the dash.
This commit is contained in:
parent
97b06e3101
commit
a37896da49
@ -60,7 +60,8 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
|
|||||||
// FIXME: this might be useless if we already filter out non-UTF8 locales
|
// FIXME: this might be useless if we already filter out non-UTF8 locales
|
||||||
foreach ( QString line, linesForLanguage )
|
foreach ( QString line, linesForLanguage )
|
||||||
{
|
{
|
||||||
if ( line.contains( "UTF-8" ) )
|
if ( line.contains( "UTF-8", Qt::CaseInsensitive ) ||
|
||||||
|
line.contains( "utf8", Qt::CaseInsensitive ) )
|
||||||
linesForLanguageUtf.append( line );
|
linesForLanguageUtf.append( line );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +365,8 @@ LocalePage::init( const QString& initialRegion,
|
|||||||
// because it's not 1995.
|
// because it's not 1995.
|
||||||
for ( auto it = m_localeGenLines.begin(); it != m_localeGenLines.end(); )
|
for ( auto it = m_localeGenLines.begin(); it != m_localeGenLines.end(); )
|
||||||
{
|
{
|
||||||
if ( !it->contains( "UTF-8", Qt::CaseInsensitive ) )
|
if ( !it->contains( "UTF-8", Qt::CaseInsensitive ) &&
|
||||||
|
!it->contains( "utf8", Qt::CaseInsensitive ) )
|
||||||
it = m_localeGenLines.erase( it );
|
it = m_localeGenLines.erase( it );
|
||||||
else
|
else
|
||||||
++it;
|
++it;
|
||||||
|
Loading…
Reference in New Issue
Block a user