Liking cljdoc? Tell your friends :D
Clojure only.

dev.arkaitz.web-base.csv

Comma-separated values a spreadsheet opens with every character intact (since 0.18.0). The separator is the comma; a spreadsheet set to another list separator — Excel under a Spanish locale — asks for it on import.

  • The bytes are UTF-8 with a byte order mark, so Excel reads a ñ as one character.
  • Every field is quoted, with its quotes doubled, and every line ends in CRLF.
  • A field a spreadsheet would read as a formula is prefixed with an apostrophe, so it is shown and never run. That is any field beginning with one of OWASP's CSV-injection characters (=, +, -, @, tab, carriage return, line feed) or their full-width forms (=, +, -, @). A product named =HYPERLINK(…) is text. A negative number becomes the text '-5 as well, which is the price OWASP's own alternatives pay too.

Every host that exports a list writes this. The guard is the part each copy got wrong, measured on the first one, which missed the line feed and the full-width forms.

Comma-separated values a spreadsheet opens with every character intact (since 0.18.0).
The separator is the comma; a spreadsheet set to another list separator — Excel under
a Spanish locale — asks for it on import.

- The bytes are UTF-8 with a byte order mark, so Excel reads a ñ as one character.
- Every field is quoted, with its quotes doubled, and every line ends in CRLF.
- A field a spreadsheet would read as a formula is prefixed with an apostrophe, so it
  is shown and never run. That is any field beginning with one of OWASP's CSV-injection
  characters (`=`, `+`, `-`, `@`, tab, carriage return, line feed) or their full-width
  forms (`=`, `+`, `-`, `@`). A product named `=HYPERLINK(…)` is text. A negative
  number becomes the text `'-5` as well, which is the price OWASP's own alternatives
  pay too.

Every host that exports a list writes this. The guard is the part each copy got
wrong, measured on the first one, which missed the line feed and the full-width
forms.
raw docstring

attachmentclj

(attachment rows filename)

rows as a CSV download saved under filename: write inside response/attachment, typed text/csv; charset=utf-8. The no-caching rule is still the host's, as response/attachment says.

`rows` as a CSV download saved under `filename`: `write` inside
`response/attachment`, typed `text/csv; charset=utf-8`. The no-caching rule is still
the host's, as `response/attachment` says.
sourceraw docstring

writeclj

(write rows)

rows, each a sequence of values (str of each, nil as empty), as the bytes of a CSV file.

`rows`, each a sequence of values (`str` of each, nil as empty), as the bytes of a
CSV file.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close