summaryrefslogtreecommitdiff
path: root/internal/jsonstring/encode_string.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/jsonstring/encode_string.go')
-rw-r--r--internal/jsonstring/encode_string.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/jsonstring/encode_string.go b/internal/jsonstring/encode_string.go
index 76bbb38..2488cb2 100644
--- a/internal/jsonstring/encode_string.go
+++ b/internal/jsonstring/encode_string.go
@@ -38,7 +38,7 @@ const (
// BackslashEscaper is describe in the main lowmemjson package docs.
type BackslashEscaper = func(rune, BackslashEscapeMode) BackslashEscapeMode
-func writeStringUnicodeEscape(w io.Writer, c rune) error {
+func WriteStringUnicodeEscape(w io.Writer, c rune) error {
const alphabet = "0123456789abcdef"
buf := [6]byte{
'\\',
@@ -84,7 +84,7 @@ func WriteStringChar(w fastio.AllWriter, c rune, escape BackslashEscapeMode) err
case '\b', '\f', '\n', '\r', '\t': // short-escape if possible
return writeStringShortEscape(w, c)
default:
- return writeStringUnicodeEscape(w, c)
+ return WriteStringUnicodeEscape(w, c)
}
case c == '"' || c == '\\': // override, gotta escape these
return writeStringShortEscape(w, c)
@@ -106,7 +106,7 @@ func WriteStringChar(w fastio.AllWriter, c rune, escape BackslashEscapeMode) err
_, err := w.WriteRune(c)
return err
default: // obey
- return writeStringUnicodeEscape(w, c)
+ return WriteStringUnicodeEscape(w, c)
}
case BackslashEscapeRawByte:
switch {