Skip to content

Support custom EOL character when encoding CSV - #26

Merged
SimonFrings merged 2 commits into
clue:masterfrom
clue-labs:custom-eol
Jan 13, 2022
Merged

Support custom EOL character when encoding CSV#26
SimonFrings merged 2 commits into
clue:masterfrom
clue-labs:custom-eol

Conversation

@clue

@clueclue commented Jan 13, 2022

Copy link
Copy Markdown
Owner

This changeset adds support for specifying a custom EOL character. This can be useful when creating a CSV file using the Encoder for Windows using the CRLF sequence (\r\n) like this:

$encoder = newClue\React\Csv\Encoder($this->output, ',', '"', '\\', "\r\n");

This is supported natively by PHP as of PHP 8.1, but this PR also implements the same feature for all supported PHP versions.

Refs https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.standard

@clueclue added the new feature New feature or request label Jan 13, 2022
@clueclue added this to the v1.2.0 milestone Jan 13, 2022
@clue
clue requested a review from SimonFringsJanuary 13, 2022 06:40
@clueclue changed the title Support custom EOL characterSupport custom EOL character when encoding CSVJan 13, 2022
@SimonFrings
SimonFrings merged commit 5269154 into clue:masterJan 13, 2022
@clue
clue deleted the custom-eol branch January 13, 2022 09:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new featureNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@clue@SimonFrings