Use configured encoding during JiBX unmarshalling

Before this change JibxMarshaller did not use the configured encoding
when unmarshalling XML. This caused issues when content being
unmarshalled was not encoded using the default encoding.

This commit fixes the issue by passing configured encoding to JiBX so
it gets used when unmarshalling instead of the default encoding.

Issue: SPR-7865
This commit is contained in:
Stevo Slavic
2012-03-15 00:22:51 +01:00
committed by Chris Beams
parent e3f544904c
commit e25183eab1
4 changed files with 46 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -349,7 +349,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
try {
IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
return unmarshallingContext.unmarshalDocument(inputStream, null);
return unmarshallingContext.unmarshalDocument(inputStream, encoding);
}
catch (JiBXException ex) {
throw convertJibxException(ex, false);