josephalevin / fson

Fortran 95 JSON Parser
60 stars 25 forks source link

Parse string with escaped character #14

Closed maxhaz closed 9 years ago

maxhaz commented 10 years ago

If I am correct, there might be an issue with strings that contain escaped character. According to JSON spec:

So, for example, a string containing only a single reverse solidus character may be represented as "\".

In the current implementation (and the forked ones), this valid JSON string:

"\\"

gives an error because the second double quote seems to be escaped (and end of string is missing).

Then the string:

"\\ "

doesn't produce an error but the resulting string is incorrect, as the backslash is not escaped.

maxhaz commented 10 years ago

I just proposed a pull request for supporting strings with escaped characters.

acroucher commented 9 years ago

Just added this fix.