Le 14/03/2012 23:35, sebb a écrit :

It's not too late to change to using Character.

The issue is the parser, this will probably degrade the performance. Unless the fields are made package private and accessed directly by the parser.


It's not possible currently to create a format with encapsulator,
commentStart and escape all null, except by knowing the value of
DISABLED.

The solution might be to introduce a quoting mode to the format. I planned to add this for the printer, but it can be useful for the parser too. This mode would have 3 states:
- NEVER: Don't use quotes, even if the encapsulator is defined
- ALWAYS: Always enclose values into quotes
- REQUIRED: Enclose the values only if necessary

Thus the quotes could be disabled with:

CSVFormat.DEFAULT.withEncapsulation(NEVER)


Likewise, encapsulator and escape are not mutually exclusive.
Should they be?

I wish it was, but MySQL actually produces files with quotes and escaped characters (delimiter and line feeds). I'm reviewing other RDBMS to see what formats we can expect in the wild.

Emmanuel Bourg


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to