Index: FavIcon/Utils.swift |
diff --git a/FavIcon/Utils.swift b/FavIcon/Utils.swift |
index 5f738d3db092c50f32e51ad0057bb18ce426f179..b52108b74eea5c5be2e2cb8425b9dd906b120e41 100644 |
--- a/FavIcon/Utils.swift |
+++ b/FavIcon/Utils.swift |
@@ -48,22 +48,38 @@ extension String { |
//swiftlint:disable cyclomatic_complexity |
func parseAsStringEncoding() -> String.Encoding? { |
switch lowercased() { |
- case "iso-8859-1", "latin1": return String.Encoding.isoLatin1 |
- case "iso-8859-2", "latin2": return String.Encoding.isoLatin2 |
- case "iso-2022-jp": return String.Encoding.iso2022JP |
- case "shift_jis": return String.Encoding.shiftJIS |
- case "us-ascii": return String.Encoding.ascii |
- case "utf-8": return String.Encoding.utf8 |
- case "utf-16": return String.Encoding.utf16 |
- case "utf-32": return String.Encoding.utf32 |
- case "utf-32be": return String.Encoding.utf32BigEndian |
- case "utf-32le": return String.Encoding.utf32LittleEndian |
- case "windows-1250": return String.Encoding.windowsCP1250 |
- case "windows-1251": return String.Encoding.windowsCP1251 |
- case "windows-1252": return String.Encoding.windowsCP1252 |
- case "windows-1253": return String.Encoding.windowsCP1253 |
- case "windows-1254": return String.Encoding.windowsCP1254 |
- case "x-mac-roman": return String.Encoding.macOSRoman |
+ case "iso-8859-1", "latin1": |
+ return String.Encoding.isoLatin1 |
+ case "iso-8859-2", "latin2": |
+ return String.Encoding.isoLatin2 |
+ case "iso-2022-jp": |
+ return String.Encoding.iso2022JP |
+ case "shift_jis": |
+ return String.Encoding.shiftJIS |
+ case "us-ascii": |
+ return String.Encoding.ascii |
+ case "utf-8": |
+ return String.Encoding.utf8 |
+ case "utf-16": |
+ return String.Encoding.utf16 |
+ case "utf-32": |
+ return String.Encoding.utf32 |
+ case "utf-32be": |
+ return String.Encoding.utf32BigEndian |
+ case "utf-32le": |
+ return String.Encoding.utf32LittleEndian |
+ case "windows-1250": |
+ return String.Encoding.windowsCP1250 |
+ case "windows-1251": |
+ return String.Encoding.windowsCP1251 |
+ case "windows-1252": |
+ return String.Encoding.windowsCP1252 |
+ case "windows-1253": |
+ return String.Encoding.windowsCP1253 |
+ case "windows-1254": |
+ return String.Encoding.windowsCP1254 |
+ case "x-mac-roman": |
+ return String.Encoding.macOSRoman |
default: |
return nil |
} |