Skip to content

Escape supplementary characters for non-UTF charsets #2578

Closed

Description

@jhy

Supplementary characters could be emitted unescaped when serialized with non-UTF, non-ASCII charsets such as ISO-8859-1.

The encoder check used only the low 16 bits, so U+100A3 could be treated as U+00A3 and considered representable, while the original character was then emitted unchanged.

The check now uses the complete code point. This still preserves the existing ASCII and UTF fast paths, with direct and serialization regressions covering the fix.

Fixed by f10c02e

Activity

  1. added
    bugA confirmed bug, that we should fix
    fixedAn {bug|improvement} that has been {fixed|implemented}
    on Aug 21, 2026
  2. added this to the 1.23.2 milestone on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA confirmed bug, that we should fixfixedAn {bug|improvement} that has been {fixed|implemented}

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions