Skip to content

throw error if a bare string literal is invalid UTF-8 #10

Closed
@StefanKarpinski

Description

@StefanKarpinski

See this thread. This changes the behavior for bare string literals previously described in #4 to be the following:

  • all bytes < 0x80: ASCIIString
  • has bytes ≥ 0x80 and is valid UTF-8: UTF8String
  • invalid UTF-8: throws an error

The b"..." string form (see #11) will let you use string syntax with \x and \u to make byte arrays. If you want to make a UTF-8 string that contains invalid UTF-8, you can do something this:

UTF8String(b"\xff\xff")

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions