x/text: "€" is incorrectly encoded as "\x80" in GB18030 (should have been "\xA2\xE3") #48691
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Playground.
https://play.golang.org/p/ELVa9gu69JX
What did you do?
Encode "€" (U+20AC).
What did you expect to see?
Pass.
What did you see instead?
The character "€" is encoded into "\x80". This is a propriety extension by Microsoft in CP936 (GBK). In GB18030 standard the proper encoding should be "\xA2\xE3".
While the GB18030 decoder recognizes both "\x80" and "\xA2\xE3" as "€" (as it should), the encoder should prefer to generate "\xA2\xE3" over the non-standard "\x80".
The text was updated successfully, but these errors were encountered: