From 47e9f4a5bb13f8895a8591e26016c47a5acea5e438c421fe36757f951c564dc9 Mon Sep 17 00:00:00 2001 From: RudenkoAD Date: Mon, 20 Jan 2025 11:30:56 +0300 Subject: [PATCH] check utf8 by default --- go/atom-decode.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/atom-decode.go b/go/atom-decode.go index 7bfd0a3..6fe0e54 100644 --- a/go/atom-decode.go +++ b/go/atom-decode.go @@ -60,7 +60,8 @@ func (ctx *Decoder) DecodeAtom() (t types.Type, err error) { ctx.types = append(ctx.types, t) ctx.depths = append(ctx.depths, ctx.depth) ctx.strs = append(ctx.strs, s) - if t == types.Str && ctx.opts != nil && !ctx.opts.DisableUTF8Check { + disabled := ctx.opts != nil && ctx.opts.DisableUTF8Check + if t == types.Str && !disabled { if !utf8.ValidString(s) { err = ErrBadUTF8 } -- 2.50.0