Csv enclosure have no effect when used programatically

Created on 23 February 2018, almost 7 years ago
Updated 16 November 2023, about 1 year ago

Hi I use csv serialization programtically.
For example with this code :


use Drupal\csv_serialization\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Serializer;
$encoders = [new CsvEncoder(',', '""', '\\')];
$serializer = new Serializer([], $encoders);
$row_csv= $serializer->serialize([['test',1,'2012-02']], 'csv') . PHP_EOL;
kint($row_csv);

I can see that there are no encolsure on each field.

also I don't understand why it'is required (throw an exception) if you dont wann enclosure, related to https://www.drupal.org/project/csv_serialization/issues/2936843 πŸ’¬ How to have no enclosure? Fixed

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France musa.thomas France πŸ‡«πŸ‡·

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024