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

Special chars escaping improvement #10

Merged
merged 4 commits into from
Oct 6, 2016
Merged

Special chars escaping improvement #10

merged 4 commits into from
Oct 6, 2016

Conversation

papswell
Copy link
Collaborator

@papswell papswell commented Oct 6, 2016

Hi there,

I added the escaping for the newline char, as you suggested. Reading the specs here, it turned out that i also forgot to escape the textDelimiter if it's contained in the field, so i fixed that too.

However, as the spec says "Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes.", i don't know if i should hardcode these chars or run the check on the dynamic options fields (rowDelimiter and endOfLine). Or maybe both ? What do u think ?

It may be worth to note that the escaping occurs only if the json is an Object, i didn't changed the Array part of the lib, because i can't spend more time on it today.

Let me know if you need me to dig it deeper :)

@kaue kaue merged commit 8cb3231 into kaue:master Oct 6, 2016
Copy link
Owner

@kaue kaue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@papswell Thanks! You are welcome to make a pr about the array part of the lib if you can!

@kaue
Copy link
Owner

kaue commented Oct 6, 2016

@papswell I think its best to use only the dynamic options (rowDelimiter, endOfLine) and double quotes

@kaue
Copy link
Owner

kaue commented Oct 6, 2016

@papswell i made a few changes to your code and added some tests.
26513e7

@kaue
Copy link
Owner

kaue commented Oct 6, 2016

@papswell + now we have travis ci =)

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.

None yet

3 participants