Skip to content

strconv: treat \x7f like the rest of ASCII when quoting #52062

@robpike

Description

@robpike

See https://go.dev/play/p/F4GlQBQL7UC

As mentioned in https://groups.google.com/d/msgid/golang-nuts/60ad41f0-10d6-417d-a604-6a151c357d93n%40googlegroups.com (which started a decade ago, almost)
, the 0x7f byte prints with \u not \x. That isn't incorrect, but it is inconsistent.

If it's worth fixing, it's a one-liner in strconv.appendEscapedRune

I vote for fixing it, although it could break some things. It trips over just what ASCII means, and to be honest \x7f is the ASCII rubout or del character.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions