Skip to content

literals for invalid characters? #44646

@stevengj

Description

@stevengj

This seems weird:

julia> "\x94"[1]
'\x94': Malformed UTF-8 (category Ma: Malformed, bad data)

julia> '\x94'
ERROR: syntax: invalid empty character literal

Shouldn't you be able to enter '\x...' for such characters, so that the literal format matches the repr?

cc @StefanKarpinski, who designed Char in #24999.

Metadata

Metadata

Assignees

No one assigned

    Labels

    strings"Strings!"unicodeRelated to unicode characters and encodings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions