Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default encoding is not set to UTF-8 for JibxMarshaller [SWS-572] #692

Closed
gregturn opened this issue Sep 23, 2009 · 4 comments
Closed

The default encoding is not set to UTF-8 for JibxMarshaller [SWS-572] #692

gregturn opened this issue Sep 23, 2009 · 4 comments
Assignees
Milestone

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented Sep 23, 2009

Alexandre Arica opened SWS-572 and commented

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"?>


Affects: 1.5.8

@gregturn
Copy link
Member Author

@gregturn gregturn commented Sep 23, 2009

Arjen Poutsma commented

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"?>
@gregturn
Copy link
Member Author

@gregturn gregturn commented Sep 23, 2009

Alexandre Arica commented

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

@gregturn
Copy link
Member Author

@gregturn gregturn commented Sep 23, 2009

Alexandre Arica commented

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

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 4, 2012

Arjen Poutsma commented

Closing old issues

@gregturn gregturn closed this May 4, 2012
@gregturn gregturn added this to the 1.5.9 milestone Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.