LibTextCodec: Avoid duplicate definition of standard encodings

This commit is contained in:
Ben Wiederhake 2021-01-30 20:39:00 +01:00 committed by Andreas Kling
parent 03b11af00f
commit aa3d915260
Notes: sideshowbarker 2024-07-18 22:40:58 +09:00

View file

@ -162,8 +162,7 @@ String get_standardized_encoding(const String& encoding)
bool is_standardized_encoding(const String& encoding)
{
auto lowercase_encoding = encoding.to_lowercase();
return lowercase_encoding.is_one_of("utf-8", "ibm666", "iso-8859-2", "iso-8859-3", "iso-8859-4", "iso-8859-5", "iso-8859-6", "iso-8859-7", "iso-8859-8", "iso-8859-8-I", "iso-8859-10", "iso-8859-13", "iso-8859-14", "iso-8859-15", "iso-8859-16", "koi8-r", "koi8-u", "macintosh", "windows-874", "windows-1250", "windows-1251", "windows-1252", "windows-1253", "windows-1254", "windows-1255", "windows-1256", "windows-1257", "windows-1258", "x-mac-cyrillic", "gbk", "gb18030", "big5", "euc-jp", "iso-2022-JP", "shift_jis", "euc-kr", "replacement", "utf-16be", "utf-16le", "x-user-defined");
return encoding.equals_ignoring_case(get_standardized_encoding(encoding));
}
String UTF8Decoder::to_utf8(const StringView& input)