UTF locale can be specified with utf8 too.

This commit is contained in:
Jakub Jedelsky
2015-03-23 15:43:23 +01:00
parent 7b9948d9ba
commit 0dc492e30a
2 changed files with 2 additions and 1 deletions

View File

@@ -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"
}

View File

@@ -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"},