Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline value parsing issue #268

Open
igu-ru opened this issue Apr 12, 2024 · 0 comments
Open

Multiline value parsing issue #268

igu-ru opened this issue Apr 12, 2024 · 0 comments

Comments

@igu-ru
Copy link

igu-ru commented Apr 12, 2024

If a JSON value contain multiple lines and looks like {"description": "A\r\nB"}, its value is expected to be parse to the string "A" & vbCr & vbLf & "B". In fact it converts to "A" & vbCr & vbCr & vbLf & "B" (doubled vbCr's).

To fix this, I suggest modify the json_ParseString function:

...
        Case json_Quote
            json_ParseString = json_BufferToString(json_Buffer, json_BufferPosition)
            json_ParseString = VBA.Replace(json_ParseString, VBA.vbCr & VBA.vbCr, VBA.vbCr) ' Fix \r\r\n -> \r\n
            json_Index = json_Index + 1
            Exit Function
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant