[ 
https://issues.apache.org/jira/browse/DIRMINA-983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117796#comment-14117796
 ] 

Emmanuel Lecharny commented on DIRMINA-983:
-------------------------------------------

The exact line is :

{code}
CharBuffer buffer = decoder.decode(ByteBuffer.wrap(data));
String str = new String(buffer.array());
{code}

The fact that we use array() here has no consequence on the length of the 
resulting string, as the limit will always be teh size of the string (we just 
created the CharBuffer the line before).

The problem you have is different. Are you on windows ?



> Problems with TextLineDecoder and special characters
> ----------------------------------------------------
>
>                 Key: DIRMINA-983
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-983
>             Project: MINA
>          Issue Type: Bug
>         Environment: Apache Mina 2.0.7
>            Reporter: Natascha
>            Priority: Minor
>
> Hey guys,
> we have special characters in our messages like "ΓΌ" or "$" and it seems there 
> is a problem in the TextLineDecoder.
> I debugged the "decodeAuto" method and my question is: Why do you use 
> "buffer.array()" instead of "buffer.toString()"?
> Problem is the array is 1 element too long so "buffer.array()" gives out a 
> blank char at the end. "buffer.toString()" pays attention to "buffer.limit" 
> so the string has perfect size.
> We made a workaround to trim it afterwards but maybe you wanted to know this?
> Greetings,
> Natascha



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to