Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird parsing of unicode characters #59

Closed
theofidry opened this issue Aug 5, 2019 · 3 comments · Fixed by #61
Closed

Weird parsing of unicode characters #59

theofidry opened this issue Aug 5, 2019 · 3 comments · Fixed by #61

Comments

@theofidry
Copy link
Contributor

Given the following JSON:

{
  "errors": [
    {
      "message": "Argument \u0022input\u0022 has an invalid value: ...."
    }
  ]
}

(for some reason a mink driver is returning this instead of \"...)

With json_decode() you will get:

{#4
  +"errors": array:1 [
    0 => {#5
      +"message": "Argument "input" has an invalid value: ...."
    }
  ]
}

However with JsonParser you will get:

{#17
  +"errors": array:1 [
    0 => {#16
      +"message": "Argument "input" has an invalid value: ...."
    }
  ]
}

Any idea of how this could be fixed?

@Seldaek
Copy link
Owner

Seldaek commented Aug 6, 2019

Looks like possibly a bug in https://github.com/Seldaek/jsonlint/blob/master/src/Seld/JsonLint/JsonParser.php#L471 - have a look?

@theofidry
Copy link
Contributor Author

Will try, thanks for the pointer

@theofidry
Copy link
Contributor Author

For my future self, might be of some help: zaach/jsonlint#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants