Author: darran.lofthouse(a)jboss.com
Date: 2007-07-24 19:06:45 -0400 (Tue, 24 Jul 2007)
New Revision: 3984
Modified:
branches/jbossws-1.2.0.SP1_JBWS-1764/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
Log:
JBWS-1764 - UTF-8 Messages Not Correctly Handled Under Windows
Modified:
branches/jbossws-1.2.0.SP1_JBWS-1764/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
===================================================================
---
branches/jbossws-1.2.0.SP1_JBWS-1764/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java 2007-07-24
22:46:30 UTC (rev 3983)
+++
branches/jbossws-1.2.0.SP1_JBWS-1764/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java 2007-07-24
23:06:45 UTC (rev 3984)
@@ -35,6 +35,7 @@
import org.jboss.ws.WSException;
import java.io.ByteArrayOutputStream;
+import java.io.UnsupportedEncodingException;
/** The base class for all Deserializers.
*
@@ -62,7 +63,7 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
StreamResult streamResult = new StreamResult(baos);
tf.newTransformer().transform(source, streamResult);
- xmlFragment = new String(baos.toByteArray());
+ xmlFragment = new String(baos.toByteArray(), "UTF-8");
if (xmlFragment.startsWith("<?xml"))
{
int index = xmlFragment.indexOf(">");
@@ -70,6 +71,8 @@
}
} catch (TransformerException e) {
WSException.rethrow(e);
+ } catch (UnsupportedEncodingException e) {
+ WSException.rethrow(e);
}
return xmlFragment;