Bug 34705

Summary: Koha should use a CSV library to generate CSV
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: dcook, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33339
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Tomás Cohen Arazi (tcohen) 2023-09-04 12:54:42 UTC
Generating CSV using a template and concatenating string using separators doesn't always generate valid CSV, and should be a avoided. The Koha codebase shouldn't contain code to deal with special escape sequences or CSV generation internals. We already include Text::CSV_XS and should just pass it arrayrefs for each row, and let the library deal with CSV complexities [1].

This was highlighted by bug 34043.

[1] https://en.wikipedia.org/wiki/Comma-separated_values#Basic_rules
Comment 1 David Cook 2023-09-04 23:18:24 UTC
+1000