Skip to content

[Serializer] Wrong default values in ehe XmlEncoder context options array #17717

Closed
@afatartmajeur

Description

@afatartmajeur

https://symfony.com/doc/current/components/serializer.html#the-xmlencoder-context-options

In the array the default values for xml_version says 1.1 and xml_encoding says utf-8, but when I use the encode() method, the xml goes out in 1.0 version and no encoding is specified.

Screenshot_20230111_162152

I had a problem with encoding accented characters that got translated in hex (É, ï, etc.) until I specified the xml_encoding in the context. The array is misleading, I thought at first that I didn't need to add the encoding because it was telling me that default was what I was utf-8.
Plus, in the page there are examples of the use of the encode() method that seems to be in version 1.0 by default, so it confirms the problem.

Screenshot_20230111_162313

Maybe other default values are wrong in the array, I didn't check them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions