Skip to content

Unescaped quotes work with ASCII but fail with Unicode characters #153

@TiagoGouvea

Description

@TiagoGouvea

Hi @josdejong !

I just realized that it works fine with ASCII text but fails when Unicode characters (accents) are present.

Works (ASCII):

  const input = '{"message": "She said "hello" to me"}';
  const result = jsonrepair(input);
  // ✅ Works: {"message": "She said \"hello\" to me"}

Fails (Unicode):

  const input = '{"text": "Ela é um "cajuzinho" pra mim"}';
  const result = jsonrepair(input);
  // ❌ Error: Colon expected at position 66

The only difference is the presence of accented characters (é) in the Portuguese text.

Is this a known limitation? Is there any workaround or configuration option to handle Unicode characters with unescaped quotes?

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