Skip to content

strconv: Unquote does not reject invalid escape sequences #47853

@dsnet

Description

@dsnet

Considering the following snippet:

s, err := strconv.Unquote(`"\udead"`) // outputs "\ufffd", nil

This is incorrect as Unquote is supposed to parse a string literal according to the Go specification for string literals, which forbids surrogate halves. I expect this to report an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions