Skip to content

Instantly share code, notes, and snippets.

@maiha
Last active September 14, 2018 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maiha/4ae9aafdba0cc04b0b4e2d631fe8e188 to your computer and use it in GitHub Desktop.
Save maiha/4ae9aafdba0cc04b0b4e2d631fe8e188 to your computer and use it in GitHub Desktop.

(SUMMARY)

Language Library Name Type
C# CsvHelper QuoteAllFields bool
Go (stdlib) N/A N/A
Haskell cassava Quoting.QuoteAll enum
Java Apache Commons CSV QuoteMode.ALL enum
Python (stdlib) QUOTE_ALL enum
Ruby fastercsv force_quotes bool

C#

CsvHelper

private bool quoteAllFields;

Go

(stdlib)

Haskell

cassava

data Quoting
    = QuoteNone        -- ^ No quotes.
    | QuoteMinimal     -- ^ Quotes according to RFC 4180.
    | QuoteAll         -- ^ Always quote.

Java

Apache Commons CSV

  • QuoteMode.ALL (Enum)
ALL          : Quotes all fields.
ALL_NON_NULL : Quotes all non-null fields.
MINIMAL      : Quotes fields which contain special characters
NON_NUMERIC  : Quotes all non-numeric fields.
NONE

Python

(stdlib)

static const StyleDesc quote_styles[] = {
    { QUOTE_MINIMAL,    "QUOTE_MINIMAL" },
    { QUOTE_ALL,        "QUOTE_ALL" },
    { QUOTE_NONNUMERIC, "QUOTE_NONNUMERIC" },
    { QUOTE_NONE,       "QUOTE_NONE" },
    { 0 }

Ruby

fastercsv

    # <b><tt>:force_quotes</tt></b>::       When set to a +true+ value, FasterCSV
    #                                       will quote all CSV fields it creates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment