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

Escaped enclosure character not supported #34

Open
GoogleCodeExporter opened this issue Mar 17, 2016 · 1 comment
Open

Escaped enclosure character not supported #34

GoogleCodeExporter opened this issue Mar 17, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Read a file having columns that use an enclosure character such as a 
double-quote.
2. Include a field value that uses an escape character (backslash) then a 
double-quote as part of the data such as "Tom's height was 5'9\" when he was 12 
years old". 

What is the expected output? 
A value containing a double-quote within the data.
Tom's height was 5'9" when he was 12 years old

What do you see instead?
Data that ends due to the presence of the escaped double-quote.
Tom's height was 5'9\

What version of the product are you using? 
v0.3.2 and v0.4.3 beta

On what operating system?
Any

Please provide any additional information below.
The Wikipedia "Comma-separated values" article was provided as the 
specification reference. The article states "Embedded double quote characters 
may then be represented by a pair of consecutive double quotes (Creativyst 
2010), or by prefixing an escape character such as a backslash (for example in 
Sybase Central)."

I do not have control over the input file so I added the following to v0.4.3 
beta before line 413
} elseif ($pch == "\\") {
//do nothing; enclosure character may be escaped with a backslash

This needs more code but got me through my problem.

Original issue reported on code.google.com by wardje...@gmail.com on 20 Oct 2014 at 10:15

@GoogleCodeExporter
Copy link
Author

Work on this project has moved to GitHub. Would you mind submitting and issue 
on the project there instead so we can properly deal with it? 

https://github.com/parsecsv/parsecsv-for-php

Thanks :) 

Original comment by cont...@jimeh.me on 21 Oct 2014 at 6:25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant