Skip to content

unicode/utf8: FullRune returns false for a known invalid byte #11733

@mpvl

Description

@mpvl

Any UTF-8 sequence that starts with 0xc0 or 0c1 is ill-formed and DecodeRune always returns RuneError, 1 for such a byte. However, FullRune of []byte("\xc0") returns false, even though the spec says it will return true for known invalid bytes.

I can look into fixing this as part of a considering a table-based utf-8 decoder. A fix would be trivial if we adopt this algorithm.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions