-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Hex chars greater than \x7f aborts silently the parsing #550
Comments
The problem here is probably in the JSON encoding. JSON only allows valid UTF-8 in strings, and |
@nikic I don't understand your answer here. A |
Any update about this issue ? |
Nope. Any suggestions on what to do about this? |
Before converting ast to json, iterate through all nodes and encode the variable containing the illegal utf-8 string using base64_encode. |
So represent it as that. A PHP So stop trying to convert an arbitrary sequence of bytes into UTF-8. |
That sounds reasonable. We can add two extra visitors for encoding/decoding all strings in base64. It's unfortunate that this is necessary, but don't really see a way around. |
Bump on this error 😃 |
Hi. I ran into an issue regarding hex chars in a double quoted string. If I have a piece of code like the following:
I get as a result the following:
But if the variable hold a value greater than \x7f, I get an empty array as a result and no error.
Any ideas?
Thank you!
The text was updated successfully, but these errors were encountered: