diff options
Diffstat (limited to 'src/encoding/json/v2_options.go')
| -rw-r--r-- | src/encoding/json/v2_options.go | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/encoding/json/v2_options.go b/src/encoding/json/v2_options.go index 4006d764cc..66bd01eb3c 100644 --- a/src/encoding/json/v2_options.go +++ b/src/encoding/json/v2_options.go @@ -204,7 +204,6 @@ type Options = jsonopts.Options // It is equivalent to the following boolean options being set to true: // // - [CallMethodsWithLegacySemantics] -// - [EscapeInvalidUTF8] // - [FormatBytesWithLegacySemantics] // - [FormatTimeWithLegacySemantics] // - [MatchCaseSensitiveDelimiter] @@ -279,23 +278,6 @@ func CallMethodsWithLegacySemantics(v bool) Options { } } -// EscapeInvalidUTF8 specifies that when encoding a [jsontext.String] -// with bytes of invalid UTF-8, such bytes are escaped as -// a hexadecimal Unicode codepoint (i.e., \ufffd). -// In contrast, the v2 default is to use the minimal representation, -// which is to encode invalid UTF-8 as the Unicode replacement rune itself -// (without any form of escaping). -// -// This only affects encoding and is ignored when decoding. -// The v1 default is true. -func EscapeInvalidUTF8(v bool) Options { - if v { - return jsonflags.EscapeInvalidUTF8 | 1 - } else { - return jsonflags.EscapeInvalidUTF8 | 0 - } -} - // FormatBytesWithLegacySemantics specifies that handling of // []~byte and [N]~byte types follow legacy semantics: // |
