[ http://issues.apache.org/jira/browse/JAXME-54?page=comments#action_65848
]
Nacho G. Mac Dowell commented on JAXME-54:
------------------------------------------
>When specifying an XML encoding as follows:
>marshaller.setProperty(Marshaller.JAXB_ENCODING, "ISO-8859-1");
>I get an UnsupportedEncodingException because OutputStreamWriter uses the
>string "8859_1" to represent this encoding.
>
I couldn't reproduce this behaviour. AFAIK ISO-8859-1 is the canonical name of
8859_1 so OutputStreamWriter shouldn't complain. I tried this with ISO-8859-1,
ISO8859-1, 8859_1 and I didn't have any problems.
>
>but it should be:
><?xml version='1.0' encoding='ISO-8859-1'?>
>otherwise the XML parser will not know what encoding it is.
>
Totally agree. The fix is simple, setting the encoding property should be:
try {
encoding = Charset.forName(pEncoding).name();
} catch (RuntimeException e) {
throw new PropertyException("Invalid charset: " + pEncoding);
}
I'll patch that today
regards,
nacho
> ISO-8859-1 encoding not working correctly.
> ------------------------------------------
>
> Key: JAXME-54
> URL: http://issues.apache.org/jira/browse/JAXME-54
> Project: JaxMe
> Type: Bug
> Components: JaxMe Core
> Versions: current (nightly)
> Environment: Win2k, Sun JDK 1.4.2
> Reporter: Alex
> Priority: Minor
>
> When specifying an XML encoding as follows:
> marshaller.setProperty(Marshaller.JAXB_ENCODING, "ISO-8859-1");
> I get an UnsupportedEncodingException because OutputStreamWriter uses the
> string "8859_1" to represent this encoding.
> But when I use it like this:
> marshaller.setProperty(Marshaller.JAXB_ENCODING, "8859_1");
> I get this in the XML:
> <?xml version='1.0' encoding='8859_1'?>
> but it should be:
> <?xml version='1.0' encoding='ISO-8859-1'?>
> otherwise the XML parser will not know what encoding it is.
--
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]