You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For instance, the following code will fail to parse, even though it is valid JSON:
string json_test = "{"a":"b\u221a","c":"d"}";
auto json = parseJson(json_test);
The issue seems to be because jsonUnescape pops an extra character while parsing the unicode sequence, and in cases like the above, that will incorrectly drop the ". In other strings it will instead just skip a character in the output.
The while loop in jsonUnescape has a "range.popFront();" at the end of it that works for all cases except the unicode sequence, which internally pops all 5 characters itself. The logic will need some minor modification (move the trailing pop to each of the other cases explicitly or similar) to avoid this problem.
The text was updated successfully, but these errors were encountered:
For instance, the following code will fail to parse, even though it is valid JSON:
string json_test = "{"a":"b\u221a","c":"d"}";
auto json = parseJson(json_test);
The issue seems to be because jsonUnescape pops an extra character while parsing the unicode sequence, and in cases like the above, that will incorrectly drop the ". In other strings it will instead just skip a character in the output.
The while loop in jsonUnescape has a "range.popFront();" at the end of it that works for all cases except the unicode sequence, which internally pops all 5 characters itself. The logic will need some minor modification (move the trailing pop to each of the other cases explicitly or similar) to avoid this problem.
The text was updated successfully, but these errors were encountered: