effectiveLocaleIsUTF8 reports whether the locale precedence chain resolves to UTF-8.
(env []string)
| 57 | |
| 58 | // effectiveLocaleIsUTF8 reports whether the locale precedence chain resolves to UTF-8. |
| 59 | func effectiveLocaleIsUTF8(env []string) bool { |
| 60 | for _, name := range []string{"LC_ALL", "LC_CTYPE", "LANG"} { |
| 61 | value, ok := envValue(env, name) |
| 62 | if !ok || value == "" { |
| 63 | continue |
| 64 | } |
| 65 | return localeIsUTF8(value) |
| 66 | } |
| 67 | return false |
| 68 | } |
| 69 | |
| 70 | func localeIsUTF8(locale string) bool { |
| 71 | lower := strings.ToLower(locale) |
no test coverage detected