Rust.Community icon indicating copy to clipboard operation
Rust.Community copied to clipboard

JSON Parser Issue: Incomplete Handling of Special Characters

Open dexsper opened this issue 1 year ago • 0 comments

We've encountered a significant issue with the your JSON parser, which mishandles certain unescaped backslashes (\), quotation marks ("), or other control characters correctly. This limitation causes our UI to break entirely, requiring us to apply workarounds, such as adding extra characters. This behavior affects the reliability of our interface, and we'd appreciate an update to improve the parser’s handling of these characters to ensure compatibility and stability.

Example of JSON:

[
    {
        "name": "123",
        "parent": "Overlay",
        "destroyUi": "123",
        "components": [
            {
                "type": "UnityEngine.UI.Image",
                "color": "0 0 0 0"
            },
            {
                "type": "RectTransform",
                "offsetmax": "0 0"
            }
        ]
    },
    {
        "name": "123_1",
        "parent": "123",
        "components": [
            {
                "type": "UnityEngine.UI.Text",
                "text": "ааа\\",
                "fontSize": 20,
                "font": "robotocondensed-regular.ttf",
                "align": "MiddleLeft"
            },
            {
                "type": "RectTransform",
                "anchormin": "0 1",
                "anchormax": "0 1",
                "offsetmin": "-50 -50",
                "offsetmax": "50 50"
            }
        ]
    }
]

Originally posted by @dassjosh in https://github.com/dassjosh/Rust.UIFramework/issues/16#issuecomment-2409037909

dexsper avatar Oct 14 '24 10:10 dexsper