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

Update new line handling #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sophist-UK
Copy link

@Sophist-UK Sophist-UK commented Jan 9, 2017

Resolves #41.

Fix as per discussion in VBA-tools/VBA-Web#270

Addresses VBA-tools#41.

Fix as per discussion in VBA-tools/VBA-Web#270
Sophist-UK added a commit to Sophist-UK/VBA-Web that referenced this pull request Jan 9, 2017
@timhall
Copy link
Member

timhall commented Jan 11, 2017

@Sophist-UK Thanks for this! I'll review and merge shortly.

@timhall
Copy link
Member

timhall commented Apr 7, 2018

Ugh, more than a year old... I'm working through these this weekend.

@AchimHentschel
Copy link

AchimHentschel commented May 9, 2018

Comparison to "\r" and "\n" is done via == in the pull request, but I think a single equals sign has to be used here.

@bwmilby
Copy link

bwmilby commented Nov 15, 2019

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

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

Successfully merging this pull request may close these issues.

Update new line handling
4 participants