axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Bergweiler (JIRA)" <>
Subject [jira] Created: (AXIS-2297) UTF-8 support for attachments (text/plain)
Date Thu, 10 Nov 2005 16:49:04 GMT
UTF-8 support for attachments (text/plain)

         Key: AXIS-2297
     Project: Apache Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.3    
 Environment: Suse Linux 9.2, 
Java sdk 1.5,

    Reporter: Simon Bergweiler

I tried to send UTF-8 encoded data as String in my attachment.
So I used the MIME type "text/plain". But after the deserialization process
the characters looked like this ( --> ü ü ü ü. ).

This is a conversion problem of the DataHandler class and the getContent() 

The Problem is placed in the class PlainTextDataHandlerDeserializer.

I fixed my UTF-8 problem as follows

into the function startElement()

public void startElement(String namespace, 
String localName,
                             String prefix, Attributes attributes,
                             DeserializationContext context)
        throws SAXException {


    // my HACK
    Object ob = dh.getContent();
        if (ob instanceof String) { inStream =dh.getInputStream();

	    StringBuffer contents = new StringBuffer();
	    BufferedReader input = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
	    String line = null;
	    while ((line = input.readLine()) != null) {
	} else {
	}// end of my HACK

I hope that helps.

-best regs,

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message