No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Here's an excerpt from the documentation of Text::CSV_XS: The separation-, escape- [sic], and escape- characters can be any ASCII character in the range from 0x20 (space) to 0x7E (tilde). Characters outside this range may or may not work as expected. Multibyte characters, like U+060c (ARABIC COMMA), U+FF0C (FULLWIDTH COMMA), U+241B (SYMBOL FOR ESCAPE), U+2424 (SYMBOL FOR NEWLINE), U+FF02 (FULLWIDTH QUOTATION MARK), and U+201C (LEFT DOUBLE QUOTATION MARK) (to give some examples of what might look promising) are therefor [sic] not allowed. If you use perl-5.8.2 or higher, these three attributes are utf8-decoded, to increase the likelihood of success. This way U+00FE will be allowed as a quote character. Is it possible to use \x{fe} for the quote_char character? If not, why not? Why is the Unicode code point U+00FE specifically mentioned in the documentation? Here's a script I used to test using \x{14} for the sep_char character and \x{fe} for the quote_char character:
Here's the output of the script: Row 1, Col 1 Is Not Quoted: þRow1Col1þ Row 1, Col 2 Is Not Quoted: þRow1Col2þ Row 1, Col 3 Is Not Quoted: þRow1Col3þ Row 2, Col 1 Is Not Quoted: Row2Col1 Row 2, Col 2 Is Not Quoted: Row2Col2 Row 2, Col 3 Is Not Quoted: Row2Col3 Row 3, Col 1 Is Not Quoted: Row3Col1 Row 3, Col 2 Is Not Quoted: þRow3Col2þ Row 3, Col 3 Is Not Quoted: þR Row 3, Col 4 Is Not Quoted: ow3Col3þ Row 4, Col 1 Is Not Quoted: þRow4Col1þ Row 4, Col 2 Is Not Quoted: Row4Col2 Row 4, Col 3 Is Not Quoted: þRow4Cþþol3þ Row 5, Col 1 Is Not Quoted: Row5Col1 Row 5, Col 2 Is Not Quoted: Row5Col2 Row 5, Col 3 Is Not Quoted: þRow5 Row 6, Col 1 Is Not Quoted: Col3þ Obviously, the \x{fe} characters aren't being recognized as quote and escape characters. (I'm running Perl 5.14.2 and Text::CSV_XS 0.90.) Jim
|
|