Skip to content

Meta.parse(repr(Char(0x110000))) fails #54396

Open
@stevengj

Description

Meta.parse(repr(Char(0x110000))) fails because

julia> show(Char(0x110000))
'\U110000'

but '\U110000' is not parseable:

julia> '\U110000'
ERROR: ParseError:
# Error @ REPL[17]:1:2
'\U110000'
#└──────┘ ── invalid unicode escape sequence

isvalid(Char(0x110000)) is false, but other invalid characters are parsed okay:

julia> '\ud800'
'\ud800': Unicode U+D800 (category Cs: Other, surrogate)

julia> isvalid('\ud800')
false

so this seems kind of inconsistent.

Options are either (a) change the printing of Char(0x110000) or (b) change the parsing to allow this. I lean towards (a). Thoughts?

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviordisplay and printingAesthetics and correctness of printed representations of objects.parserLanguage parsing and surface syntaxunicodeRelated to unicode characters and encodings

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions