Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

UTF-8 not handled while writing #16

@laanwj

Description

@laanwj

UTF-8 is not handled while writing strings in json_escape. The result of this is that unicode sequences like '\u1234' will be expanded to their UTF-8 equivalent on a roundtrip, and re-encoded as multiple unicode characters \u00XX\u00XX... which is not correct.

This could be handled:

If the input/output is UTF-8 encoded, UTF-8 sequences in strings can be passed through on output without any processing (according to RFC 4627 "All Unicode characters may be placed within the quotation marks except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F).")

From RFC 4627:

JSON text SHALL be encoded in Unicode.  The default encoding is
UTF-8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions