Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
SRP_JSON converts text differently
I have some code which uses SRP_JSON to convert text to JSON
In the past it converts the text correctly, now it seems something has changed since the last update of SRP utilities
I have an example of my code here:
this results in :
{"Login":[{"Name":"Andr\uffffffe9"}]}
while it used to result in :
{"Login":[{"Name":"André"}]}
It seems this has something to do with some encoding issue
Is it possible to make it optionable which encoding is used?
In the past it converts the text correctly, now it seems something has changed since the last update of SRP utilities
I have an example of my code here:
If SRP_JSON(RootHandle, "NEW") then
If SRP_JSON(ArrayHandle, "NEW", "ARRAY") then
If SRP_JSON(ObjectId, "NEW") then
SRP_JSON(ObjectId, 'setValue', 'Name', 'André', 'STRING')
SRP_JSON(ArrayHandle, 'ADD', ObjectId)
SRP_JSON(ObjectId, 'RELEASE')
end
SRP_JSON(RootHandle, 'SET', "Login", ArrayHandle)
SRP_JSON(ArrayHandle, 'RELEASE')
end
// Now get the actual JSON
rv = SRP_JSON(RootHandle, "STRINGIFY", "Fast")
// All done with the root object
SRP_JSON(RootHandle, "RELEASE")
end
this results in :
{"Login":[{"Name":"Andr\uffffffe9"}]}
while it used to result in :
{"Login":[{"Name":"André"}]}
It seems this has something to do with some encoding issue
Is it possible to make it optionable which encoding is used?
Comments
{"Login":[{"Name":"Andr\u00e9"}]}
So converting é to \uffffffe9 is invalid anyways, imho.
In short, it should now output as you preferred without having to ask it to.