You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ji...@apache.org on 2004/05/05 11:05:56 UTC

[jira] Commented: (WSFX-1) WsDoAllSender does not correctly handles international characters

The following comment has been added to this issue:

     Author: Christof Soehngen
    Created: Wed, 5 May 2004 2:05 AM
       Body:
I can reproduce the behaviour.

I put some logs before and after the WSDoAllSender activity (serverside, only signature):

Begin of WSDoAllSender, SOAP Message is:
<Geschlecht>m&#xE4;nnlich</Geschlecht>

End of WSDoAllSender, SOAP Message is:
<Geschlecht>m&#xC3;&#xA4;nnlich</Geschlecht>

I applied the suggested patch and it now works fine.
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/WSFX-1?page=comments#action_35406

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/WSFX-1

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: WSFX-1
    Summary: WsDoAllSender does not correctly handles international characters
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: WSFX
 Components: 
             WSS4J

   Assignee: 
   Reporter: Rodrigo Ruiz

    Created: Tue, 27 Apr 2004 3:18 AM
    Updated: Wed, 5 May 2004 2:05 AM
Environment: Any platform
JDK 1.4
file.encoding != UTF-8 (client-side)

Description:
The request is corrupted when it contains international characters.

I have no access to the CVS, so it's difficult to me to provide a patch as I would like, but I have tracked the bug down to the following code in WSDoAllSender class:


public void invoke(MessageContext mc) throws AxisFault {

  ...

  ByteArrayOutputStream os = new ByteArrayOutputStream();
  XMLUtils.outputDOM(doc, os, true);
  String osStr = os.toString();

  ...

}

The outputDOM seems to generate the XML string in UTF-8, but if file.encoding has another value, the os.toString() call obtains a corrupted string.

The following replacement works for me:

  String osStr = null;
  try {
    osStr = os.toString("UTF-8");
  }
  catch (UnsupportedEncodingException e) {
    osStr = os.toString();
  }




---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira