Hi Ozgun,

Excellent point. This is clearly a bug that we will fix by using an
InputStreamReader instead of a raw InputStream. We will also add the
character set of the parent representation as a parameter of this toString()
method.

Best regards,
Jerome  

> -----Message d'origine-----
> De : Atacan, Ozgun [mailto:[EMAIL PROTECTED] 
> Envoyé : mercredi 4 avril 2007 11:01
> À : [email protected]
> Objet : Representation getText() encoding problem
> 
> Hi,  
> 
> i am using getText() method of my Representations to use 
> their content directly as a String object. But i have 
> problems with special characters encoding . Might there be a 
> bug inside ByteUtils.toString(InputStream inputStream) method ?
> 
>      StringBuilder sb = new StringBuilder();
> 
>      InputStream is = new BufferedInputStream(inputStream);
> 
>         int nextByte = is.read();
> 
>         while (nextByte != -1) {
> 
>           sb.append((char) nextByte);
> 
>               nextByte = is.read();
> 
>         }
> 
> As far as I know some unicode character can be more than one 
> byte (two or three). Can this char datatype casting be a 
> possible bug? 
> 
>  
> 
> Kind Regards
> 
>  
> 
> Özgün Atacan
> 
>  
> 
> 
> **************************************************************
> **********
> The information contained in this message or any of its 
> attachments may be confidential and is intended for the 
> exclusive use of the addressee(s). Any disclosure, 
> reproduction, distribution or other dissemination or use of 
> this communication is strictly prohibited without the express 
> permission of the sender. The views expressed in this email 
> are those of the individual and not necessarily those of Sony 
> or Sony affiliated companies. Sony email is for business use only.
> 
> This email and any response may be monitored by Sony to be in 
> compliance with Sony’s global policies and standards
> 
> 

Reply via email to