You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternatively, all character validation (including UTF-8) could be ignored and let Go's 0xfffd take over if a user ever wants a string from StringData.
I'm very new to Go, but it seems that this would be contrary to the ideals of compatibility. I think adding a decoder setting, perhaps decoder.IgnoreInvalidCharacters (defaulting to false) would be a better path. This would enable the desired behavior without impacting existing code.
After adding the setting, the condition would become if !d.IgnoreInvalidCharacters && !isInCharacterRange(r)
My particular problem would be solved by checking
Decoder.Strict
here:go/src/encoding/xml/xml.go
Line 1140 in 282cd56
Alternatively, all character validation (including UTF-8) could be ignored and let Go's
0xfffd
take over if a user ever wants astring
fromStringData
.go/src/encoding/xml/xml.go
Line 1133 in 282cd56
The text was updated successfully, but these errors were encountered: