axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Brennan <Michael_Bren...@Allegis.com>
Subject Internationalization problem (was RE: cvs commit: xml-axis/java/s rc/org/apache/axis/utils XMLUtils.java)
Date Wed, 04 Apr 2001 22:20:44 GMT
I'll confess that I'm not up to speed with what the Axis team is doing, but
the below code looks like a problem to me. The
ByteArrayOutputStream.toString method uses the platform default character
encoding. This would, I think, pose problems for internationalized text.

Gotta watch out for those byte array<->String conversion routines.  :-)

>     public static String DocumentToString(Document doc) {
>       try {
>         ByteArrayOutputStream  baos = new ByteArrayOutputStream();
>         XMLSerializer  xs = new XMLSerializer( baos, new 
> OutputFormat() );
>         xs.serialize( (Document) doc );
>         baos.close();
>         return( baos.toString() );
>       }
>       catch( Exception e ) {
>         e.printStackTrace();
>       }
>       return( null );
>     }

Mime
View raw message