Skip to content

List CSV encoder's context options #12461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2020
Merged

List CSV encoder's context options #12461

merged 1 commit into from
Oct 3, 2020

Conversation

malarzm
Copy link
Contributor

@malarzm malarzm commented Oct 10, 2019

I needed to add new option output_utf8_bom introduced in symfony/symfony#33896 and since context options weren't documented I figured I'll list them all. Format and text is based on XML's part of the docs.

@@ -1254,6 +1247,52 @@ These are the options available:
``remove_empty_tags``
If set to true, removes all empty tags in the generated XML.

The CSV Encoder
---------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should keep the same underline as XML encoder, because the should be on the same hierachy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already is on the same level, check out the rendered docs: https://pr-12461-6xsc4kq-nq3xa5jtywvyc.eu.s5y.io/components/serializer.html

@OskarStark
Copy link
Contributor

@javiereguiluz how do we proceed here?

It's a bit confusing to have headlines for each encoder... 🤔:
Screenshot 2019-10-11 20 20 20

And I am unsure if this should go into 4.3 instead of 4.4 🤔

fabpot added a commit to symfony/symfony that referenced this pull request Oct 13, 2019
…alarzm)

This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer][CSV] Add context options to handle BOM

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #33684
| License       | MIT
| Doc PR        | symfony/symfony-docs#12461

This allows BOM handling in en/decoded CSV files. To keep current behaviour intact both skipping BOM at the beginning of the CSV and outputting BOM are an opt-in feature.

Personally I'd propose to make `SKIP_INPUT_BOM` default to `false` in 5.0 so the BOM is transparent and people that for some reasons expect BOM characters to be present in the parsed text explicitly opt-out of trimming it.

Commits
-------

3eb3668 Add context options to handle BOM
@OskarStark OskarStark removed the Waiting Code Merge Docs for features pending to be merged label Nov 1, 2019
@OskarStark
Copy link
Contributor

The code is merged, @javiereguiluz can you please give a final review here? Thank you! 🙏

wouterj added a commit that referenced this pull request Oct 3, 2020
@wouterj wouterj merged commit 367b05b into symfony:4.4 Oct 3, 2020
@wouterj
Copy link
Member

wouterj commented Oct 3, 2020

Sorry that this PR was open for sooo long @malarzm. Fortunately, it's merged now! Thanks a lot for taking the time to not only document a feature you proposed - but also to document all other available options.

wouterj added a commit that referenced this pull request Oct 3, 2020
* 4.4:
  [#12697] Some minor tweaks
  [DependencyInjection] Add docs for default priority method for tagged services
  [#12461] Added versionadded directive
  List CSV encoder's context options
wouterj added a commit that referenced this pull request Oct 3, 2020
* 5.1:
  Removed versionadded 4.4 directives
  [#12697] Some minor tweaks
  [DependencyInjection] Add docs for default priority method for tagged services
  [#12461] Added versionadded directive
  List CSV encoder's context options
@malarzm malarzm deleted the patch-1 branch October 4, 2020 17:37
@malarzm
Copy link
Contributor Author

malarzm commented Oct 4, 2020

Glad it got merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants