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)
| 199 | // need to be quoted, and they are considered equivalent to dash characters by |
| 200 | // the CLDR standard: http://cldr.unicode.org/. |
| 201 | func 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 |
no outgoing calls
no test coverage detected