Skip to content

JSON.parse rejects a valid lone UTF-16 surrogate escape #5576

Closed

Description

@robertmorelli

Describe the bug
JSON.parse throws a SyntaxError for "\\ud83d". A lone surrogate escape is valid JSON and should produce a string containing one UTF-16 code unit.

To Reproduce

console.log(JSON.parse('"\\ud83d"').charCodeAt(0).toString(16)); // throws SyntaxError

Expected behavior
prints d83d

Build environment:

  • OS: macOS
  • Version: 27.0 (build 26A428)
  • Target triple: aarch64-apple-darwin
  • Rustc version: rustc 1.99.0 (b940084d7 2026-09-28) (Homebrew)

Activity

  1. added a commit that references this issue on Oct 12, 2026
    63a67e6
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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions