Skip to content

Allow specifying encodings other than UTF-8 in XML declaration written #315

Open
@cassiomolin

Description

@cassiomolin

The UTF-8 encoding is hard coded in the ToXmlGenerator source code:

if (Feature.WRITE_XML_1_1.enabledIn(_formatFeatures)) {
    _xmlWriter.writeStartDocument("UTF-8", "1.1");
} else if (Feature.WRITE_XML_DECLARATION.enabledIn(_formatFeatures)) {
    _xmlWriter.writeStartDocument("UTF-8", "1.0");
} else {
    return;
}

Once ToXmlGenerator is final, there might not be an easy way to have other encodings such as ISO-8859-1:

<?xml version="1.0" encoding="ISO-8859-1"?>

See this question in Stack Overflow for reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adding-declarationsIssues related to adding non-content declarations to XML outputmost-wantedTag to indicate that there is heavy user +1'ing action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions