Search Issue Tracker
By Design
Votes
2
Found in
2018.4
2019.3.4f1
2020.2
Issue ID
1260637
Regression
No
[WebGL] Misleading JSON parse errors are thrown when Javascript interop crashes on unicode chars
Reproduction steps:
1. Open the attached project ("case_1260637-unicode-javascript.zip")
2. Switch the build target to WebGL
3. Make a build and run it in browser
Expected result: No errors are thrown (or errors explain the real issue)
Actual result: "ArgumentException: JSON parse error: Missing a comma or '}' after an object member." error is thrown, even though the JSON file is correct
Reproducible with: 2018.4.25f1, 2019.4.4f1, 2020.1.0b16, 2020.2.0a18
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [OpenGLES][XR] Zooming in on the camera's URP opaque texture causes "double vision" on Quest in OpenGLES3
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
Resolution Note (2020.2.X):
Problem with user code:
stringToUTF8(returnStr, buffer, returnStr.length + 1);
is incorrect. For stringToUTF8(), you need to pass the maximum number of bytes that are allowed to be written as the last parameter, but here the actual character length of the string + 1 is being passed. Since the character 'é' takes up two bytes, the code ends up swallowing one byte from the output, which caused the '}' to be dropped.