MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / EncodeLocaleName

Function EncodeLocaleName

pkg/sql/lex/encode.go:188–197  ·  view source on GitHub ↗

EncodeLocaleName writes the locale identifier in s to buf. Any dash characters are mapped to underscore characters. Underscore characters do not need to be quoted, and they are considered equivalent to dash characters by the CLDR standard: http://cldr.unicode.org/.

(buf *bytes.Buffer, s string)

Source from the content-addressed store, hash-verified

186// need to be quoted, and they are considered equivalent to dash characters by
187// the CLDR standard: http://cldr.unicode.org/.
188func EncodeLocaleName(buf *bytes.Buffer, s string) {
189 for i, n := 0, len(s); i < n; i++ {
190 ch := s[i]
191 if ch == '-' {
192 buf.WriteByte('_')
193 } else {
194 buf.WriteByte(ch)
195 }
196 }
197}
198
199// EncodeSQLBytes encodes the SQL byte array in 'in' to buf, to a
200// format suitable for re-scanning. We don't use a straightforward hex

Callers 4

collatedStringTypeSQLMethod · 0.92
FormatMethod · 0.92
FormatMethod · 0.92
FormatMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…