[ http://issues.apache.org/jira/browse/XALANJ-1915?page=all ]
Brian Minchau closed XALANJ-1915:
---------------------------------
Assign To: (was: Xalan Developers Mailing List)
> Default encoding of UTF-8 should not be replaced when an encoding is not
> explictly set
> --------------------------------------------------------------------------------------
>
> Key: XALANJ-1915
> URL: http://issues.apache.org/jira/browse/XALANJ-1915
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Versions: Latest Development Code
> Environment: Operating System: Other
> Platform: Other
> Reporter: Brian Minchau
> Fix For: 2.7
>
> It appears that the ToXMLStream serialzier which has an initial default
> value of UTF-8 for the encoding has it replaced even when no
> encoding is explicitly set on the <xsl:output ... /> element.
> The code in ToStream.init(Writer, Properties, boolean, boolean) does this:
> String oldEncoding = getEncoding(); // get the previously set
> encoding
> String newEncoding = format.getProperty(OutputKeys.ENCODING);
> newEncoding = Encodings.getMimeEncoding(newEncoding);
> . . .
> if (newEncoding != null
> && !newEncoding.equals(oldEncoding))
> {
> . . .
> If the initial assignment of newEncoding is null then the encoding is
> not being reset. However the next line asks the Encodings object to get
> an encoding from a null argument, which it does.
> On most platforms UTF-8 is returned and old encoding and new encoding are the
> same and nothing happens. But on some platforms other values are returned and
> we accidentally wipe out the default value even though we didn't explicitly
> set
> an encoding.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]