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

Francois Kritzinger commented on CAMEL-5718:
--------------------------------------------

Not so sure. SmppMessage.getBody() doesn't appear to do any conversion because 
the body is set to a String at SmppBinding.createSmppMessage (line 109) and 
also at SmppMessage.createBody (line 94). All SmppMessage.getBody() does is 
call MessageSupport.getBody(Class<T> type, Object body), which simply casts 
'body' to 'type' if the body is already an instance of the type, which is the 
case here.

I think the problem is where the body is being set using String(byte[]) (at the 
above-mentioned locations). This String constructor decodes the byte array 
using the system's default charset. I initially was setting the body to a 
byte[] and I think that would prevent conversion and just seems generally safer 
and more sensible. I changed it to a String at the last minute for the sake of 
consistency because the body is a String when it's not 8-bit and the tests were 
passing under my default charset of Latin1.
                
> Bodies of SMs with 8-bit data_coding are mangled
> ------------------------------------------------
>
>                 Key: CAMEL-5718
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5718
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-smpp
>            Reporter: Francois Kritzinger
>            Assignee: Christian Müller
>             Fix For: 2.9.5, 2.10.3, 2.11.0
>
>         Attachments: 8bit_deliver_sm_bodies_mangled.diff, 
> camel_smpp_8bit_messages.diff
>
>
> Bytes in the body of 8-bit SUBMIT_SMs which do not fall within the chosen 
> charset's range are set to '?', which is obviously wrong because 8-bit/binary 
> data should not be modified in any way.
> EDIT: Turns out the RX SMs (DELIVER_SM, etc.) were also affected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to