jsondecode: preserve original string
3 次查看(过去 30 天)
显示 更早的评论
I would like to preserve the original string (that contains unicode characters??) when I use the function jsondecode.
Example:
jsontext='{"IDs":"\u00b0C"}'
Data=jsondecode(jsontext)
Result obtained:
Data =
struct with fields:
IDs: '°C'
Desired result:
Data =
struct with fields:
IDs: '\u00b0C'
Thanks for the help!
0 个评论
采纳的回答
Rik
2022-7-6
If the jsondecode function does not mention this as an option, it is not possible without modifying the code, which you should not do for an internal function.
I have written a JSON decoder as well (be aware that it can be very slow for large and deeply nested objects). You can get it from the FEX and then edit the lines where unicode objects are parsed.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 JSON Format 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!