Conversation
Addresses VBA-tools#41. Fix as per discussion in VBA-tools/VBA-Web#270
Resolves VBA-tools#270 and VBA-tools/VBA-JSON#41. See VBA-tools/VBA-JSON#44 for matching fix to VBA-JSON.
|
@Sophist-UK Thanks for this! I'll review and merge shortly. |
|
Ugh, more than a year old... I'm working through these this weekend. |
|
Comparison to "\r" and "\n" is done via == in the pull request, but I think a single equals sign has to be used here. |
|
I don't think the proposed solution complies with ECMA-404. The JSON spec has \n and \r as the encoding for vbLf and vbCr respectively and does not include any conversion between Unix/Mac line endings and Windows vbCrLf. A well formed JSON from an external source should be consistent in how it treats normal line endings. So it would be faster to do a search/replace than to do it with a comparison for each line ending. These days I would think that you would either see \n or \r\n but not \n\r nor \r. If the source doesn't contain \r\n, then you could post-process strings with a replace of vbLf with vbCrLf to get normal Windows line endings. I would suggest that be a setting for something like "normalizeWindowsLineEndings" which would default to "false". Cross post from issue #67 |
Resolves #41.
Fix as per discussion in VBA-tools/VBA-Web#270