[SWS-572] The default encoding is not set to UTF-8 for JibxMarshaller Created: 23/Sep/09  Updated: 04/May/12  Resolved: 10/Nov/09

Status: Closed
Project: Spring Web Services
Component/s: OXM
Affects Version/s: 1.5.8
Fix Version/s: 1.5.9

Type: Bug Priority: Major
Reporter: Alexandre Arica Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0.15h
Time Spent: 1m
Original Estimate: 10m


 Description   

In the class "org.springframework.oxm.jibx.JibxMarshaller" the default encoding is not set to UTF-8 as specified in the Java-Doc of the method 'setEncoding()'.

Therefore, when we marshal an object with "org.springframework.oxm.jibx.JibxMarshaller", the output XML does not contain the encoding attribute:

<?xml version="1.0"?>

instead of

<?xml version="1.0" encoding="UTF-8"?>



 Comments   
Comment by Arjen Poutsma [ 23/Sep/09 ]

I am not sure what you mean. The default encoding for XML is UTF-8 (unless otherwise specified with a BOM), so

<?xml version="1.0"?>

is typically identical to

<?xml version="1.0" encoding="UTF-8"?>

Comment by Alexandre Arica [ 23/Sep/09 ]

Hi Arjen,

Well basically in the code of "JibxMarshaller" the private member "private String encoding;" is not explicitly set to UTF-8.
If I set it specifically to UTF-8 using the setter 'setEncoding()' then the generated XML document contains: encoding="UTF-8" otherwise it does not.
The default behaviour "JibxMarshaller" is therefore not what we expect.

Cheers

Comment by Alexandre Arica [ 23/Sep/09 ]

For example, in the class "org.springframework.oxm.castor.CastorMarshaller", the default encoding is explicitly set to UTF-8 by default.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Fri Dec 15 21:37:31 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.