MCPcopy Create free account
hub / github.com/coder/coder / effectiveLocaleIsUTF8

Function effectiveLocaleIsUTF8

agent/reconnectingpty/reconnectingpty.go:59–68  ·  view source on GitHub ↗

effectiveLocaleIsUTF8 reports whether the locale precedence chain resolves to UTF-8.

(env []string)

Source from the content-addressed store, hash-verified

57
58// effectiveLocaleIsUTF8 reports whether the locale precedence chain resolves to UTF-8.
59func 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
70func localeIsUTF8(locale string) bool {
71 lower := strings.ToLower(locale)

Callers 1

withTerminalEnvFunction · 0.85

Calls 2

envValueFunction · 0.85
localeIsUTF8Function · 0.85

Tested by

no test coverage detected