MCPcopy Create free account
hub / github.com/dolthub/doltgresql / EncodeLocaleName

Function EncodeLocaleName

postgres/parser/lex/encode.go:201–210  ·  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

199// need to be quoted, and they are considered equivalent to dash characters by
200// the CLDR standard: http://cldr.unicode.org/.
201func EncodeLocaleName(buf *bytes.Buffer, s string) {
202 for i, n := 0, len(s); i < n; i++ {
203 ch := s[i]
204 if ch == '-' {
205 buf.WriteByte('_')
206 } else {
207 buf.WriteByte(ch)
208 }
209 }
210}
211
212// EncodeSQLBytes encodes the SQL byte array in 'in' to buf, to a
213// 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