mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
UTF locale can be specified with utf8 too.
This commit is contained in:
@@ -17,5 +17,5 @@ func GetLocaleCharset(env map[string]string) string {
|
||||
|
||||
func IsUtf8Locale(env map[string]string) bool {
|
||||
charset := GetLocaleCharset(env)
|
||||
return charset == "utf-8" || charset == "UTF-8"
|
||||
return charset == "utf-8" || charset == "UTF-8" || charset == "utf8"
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ func TestGetLocaleCharset(t *testing.T) {
|
||||
expectedResult string
|
||||
}{
|
||||
{"pl_PL.UTF-8", "pl_PL.ISO-8859-1", "pl_PL.ISO-8859-2", "UTF-8"},
|
||||
{"cz_CS.utf8", "pl_PL.ISO-8859-1", "pl_PL.ISO-8859-2", "utf8"},
|
||||
{"", "pl_PL.ISO-8859-1", "pl_PL.ISO-8859-2", "ISO-8859-1"},
|
||||
{"", "", "pl_PL.ISO-8859-2", "ISO-8859-2"},
|
||||
{"", "", "", "US-ASCII"},
|
||||
|
||||
Reference in New Issue
Block a user