Only use UTF-8 locales.

This commit is contained in:
Teo Mrnjavac 2016-08-02 12:42:28 +02:00
parent dbae146eaf
commit 5e12096e4b

View file

@ -281,6 +281,22 @@ LocalePage::init( const QString& initialRegion,
m_localeGenLines.append( lineString );
}
}
if ( m_localeGenLines.isEmpty() )
{
cDebug() << "WARNING: cannot get list of supported locales from anywhere.";
return; // something went wrong and there's nothing we can do about it.
}
// Assuming we have a list of supported locales, we usually only want UTF-8 ones
// because it's not 1995.
for ( auto it = m_localeGenLines.begin(); it != m_localeGenLines.end(); )
{
if ( !it->contains( "UTF-8", Qt::CaseInsensitive ) )
it = m_localeGenLines.erase( it );
else
++it;
}
}