You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Francois Kritzinger (JIRA)" <ji...@apache.org> on 2012/10/19 17:28:11 UTC

[jira] [Created] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Francois Kritzinger created CAMEL-5718:
------------------------------------------

             Summary: Bodies of SUBMIT_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


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.

--
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

[jira] [Updated] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Attachment: camel_smpp_8bit_messages.diff

This patch supercedes the previous one. It fixes the mangling of 8-bit bodies in all the message types I could identify (basically all subclasses of SmppSmCommand: SmppSubmitSmCommand, SmppSubmitMultiCommand, SmppReplaceSmCommand).

I.e.:

- Setting data coding or alphabet to one of the 8-bit values prevents body from getting narrowed to charset;

- Data coding takes precedence over alphabet. I.e. if both headers are set, only the value of the data coding is taken into account and the alphabet is ignored.
                
> Bodies of SUBMIT_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: camel_smpp_8bit_messages.diff, camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Work started] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-5718 started by Christian Müller.

> Bodies of TX 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: camel_smpp_8bit_messages.diff, test_deliver_sm_bodies_not_mangled.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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Commented] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480119#comment-13480119 ] 

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

I guess all the other message types need to be checked too. I will do so on Monday and provide another patch if necessary. I know DELIVER_SM works fine though.
                
> Bodies of SUBMIT_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
>         Attachments: camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Assigned] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller reassigned CAMEL-5718:
---------------------------------------

    Assignee: Christian Müller
    
> Bodies of SUBMIT_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: camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Updated] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Attachment:     (was: test_deliver_sm_bodies_not_mangled.diff)
    
> Bodies of TX 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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490044#comment-13490044 ] 

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

I added '8bit_deliver_sm_bodies_mangled.diff' and removed the previous patch which contained all the failing tests you pointed out. That one was called 'test_deliver_sm_bodies_not_mangled.diff'. Both of the currently-attached patches need to be committed.
                
> 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

[jira] [Updated] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Description: 
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.

  was:
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 it the RX SMs (DELIVER_SM, etc.) were also affected.

    
> 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

[jira] [Work started] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-5718 started by Christian Müller.

> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Babak Vahdat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495153#comment-13495153 ] 

Babak Vahdat commented on CAMEL-5718:
-------------------------------------

That is the usage of the following header while converting:

{code}
Exchange.CHARSET_NAME
{code}
                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488533#comment-13488533 ] 

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

I am on Linux and my default charset is Latin1.

But anyway, I have improved the tests (they now fail on my system as well because they try every supported character encoding) and have provided the code fixes in the patch called '8bit_deliver_sm_bodies_mangled.diff', which I will attach soon.
                
> Bodies of TX 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: camel_smpp_8bit_messages.diff, test_deliver_sm_bodies_not_mangled.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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480823#comment-13480823 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

Looking forward for the patch - and the unit test ;-)
                
> Bodies of SUBMIT_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
>             Fix For: 2.9.5, 2.10.3, 2.11.0
>
>         Attachments: camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Updated] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Description: 
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 it the RX SMs (DELIVER_SM, etc.) were also affected.

  was:
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 it the RX SMs (DELIVER_SMwere also affected.

    
> 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 it 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496015#comment-13496015 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

It would be great if you could have a look at it. I did a small update two days ago but it didn't fixed the issue on Ubuntu. :-(
                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494850#comment-13494850 ] 

Claus Ibsen commented on CAMEL-5718:
------------------------------------

https://builds.apache.org/job/Camel.trunk.fulltest/org.apache.camel$camel-smpp/1090/testReport/
                
> 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

[jira] [Updated] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Summary: Bodies of SMs with 8-bit data_coding are mangled  (was: Bodies of TX SMs with 8-bit data_coding are mangled)
    
> 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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496159#comment-13496159 ] 

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

I have had a look and I am of the opinion that leaving 8-bit bodies as byte[] is the only solution.

It is not possible to store a byte[] inside a String (using e.g. String.String(byte[])) and read those bytes out again later (using e.g. String.getBytes()) without involving the system's default charset. And as patch [1] shows, this fails on at least one of my system's supported charsets (Big5, in this case). In a nutshell, storing 8-bit data inside a String is just plain wrong.

I don't think consistency (String vs. byte[] bodies) is an issue after all because users will still be able to get a String version of the body by calling SmppMessage.getBody(String.class) (although this will cause conversion on some systems). I think it's actually quite intuitive to retrieve 8-bit data using getBody(byte[].class) or (byte[])getBody().

I have attached two patches. *Note that these patches are not compatible*: patch [1] exists solely to show how I reproduced the CI failures on my machine. The real fix and its unit tests are in patch [2].

[1] _ci_failures_reproduced.diff_: For informational purposes only; modifies the tests that were causing the CI machine to fail so that they fail on my machine. (They should now fail on any machine which supports a reasonable set of character encodings.)

[2] _ci_failures_fixed_and_tested.diff_: The real fix and its unit tests.

                
> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Babak Vahdat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495151#comment-13495151 ] 

Babak Vahdat commented on CAMEL-5718:
-------------------------------------

They are still failing even after the latest fix:

https://builds.apache.org/job/Camel.trunk.fulltest/1092/org.apache.camel$camel-smpp/#showFailuresLink

Not sure if this sounds reasonable to you but I think the problem in both cases is the following line:

{code}
smppMessage.getBody(String.class).getBytes()
{code}

Which makes use of the platform's default charset for the byte array being returned. However the other body is a UTF-8 encoded byte array! So I think the usage of

{code}
IOConverter.toString(byte[] data, Exchange exchange)
{code}

could resolve the problem. To reproduce the problem on your local box you could set the following system property while running the tests:

{code}
-Dfile.encoding=UTF-16
{code}

                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494865#comment-13494865 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

I will fix it later today.
                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495716#comment-13495716 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

I can reproduce this issue on my new Ubuntu instance. Looking for the issue...
                
> 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

[jira] [Updated] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Attachment:     (was: camel_smpp_8bit_submit_sm.diff)
    
> Bodies of TX 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: 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.

--
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

[jira] [Comment Edited] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482215#comment-13482215 ] 

Francois Kritzinger edited comment on CAMEL-5718 at 10/23/12 9:09 AM:
----------------------------------------------------------------------

As mentioned before, DELIVER_SM bodies are not mangled, but here is a patch (test_deliver_sm_bodies_not_mangled.diff) containing tests that confirm the fact in case you think it would be useful.
                
      was (Author: frankzinger):
    As mentioned before, DELIVER_SM bodies are not mangled, but here is a patch containing tests that confirm the fact in case you think it would be useful.
                  
> Bodies of TX 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: camel_smpp_8bit_messages.diff, test_deliver_sm_bodies_not_mangled.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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13491276#comment-13491276 ] 

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

Sorry for the conflicts. I checked both of the affected files (SmppMessageTest.java and SmppSubmitSmCommandTest.java; does that look right?) and it all looks OK to me. I have also been made aware of Checkstyle, and actually used it for the second patch, so it shouldn't be a problem again. Thanks!
                
> 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

[jira] [Reopened] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller reopened CAMEL-5718:
-------------------------------------

    Regression: Regression
    
> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495652#comment-13495652 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

I create a new Ubuntu VM and run the test locally. On my MacOS all tests pass.
                
> 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

[jira] [Updated] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Attachment: ci_failures_fixed_and_tested.diff
                ci_failures_reproduced.diff
    
> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Commented] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488301#comment-13488301 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

After applying your patches, 4 test on my machine failed:

{noformat}
Results :

Failed tests: 
  createSmppMessageFromDefaultDataCodingDeliverSmShouldNotModifyBody(org.apache.camel.component.smpp.SmppBindingTest): arrays first differed at element [0]; expected:<-1> but was:<-40>
  createSmppMessageFromLatin1DataCodingDeliverSmShouldNotModifyBody(org.apache.camel.component.smpp.SmppBindingTest): arrays first differed at element [0]; expected:<-1> but was:<-40>
  createSmppMessageFrom8bitDataCodingDeliverSmShouldNotModifyBody(org.apache.camel.component.smpp.SmppBindingTest): arrays first differed at element [0]; expected:<-1> but was:<-40>
  createBodyShouldNotMangle8bitDataCodingShortMessage(org.apache.camel.component.smpp.SmppMessageTest): arrays first differed at element [0]; expected:<-1> but was:<-40>

Tests run: 125, Failures: 4, Errors: 0, Skipped: 4
{noformat}

Could you please have a look at it? What's your OS and default charset?
                
> Bodies of TX 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: camel_smpp_8bit_messages.diff, test_deliver_sm_bodies_not_mangled.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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13488535#comment-13488535 ] 

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

The tests in the other patch should probably also be updated to try every supported charset.
                
> Bodies of TX 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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490031#comment-13490031 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

I'm a bit confused. Do you work on an additional patch? Are both attached patches needed or only "8bit_deliver_sm_bodies_mangled.diff"?
                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498001#comment-13498001 ] 

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

Cool, thanks to you guys too. Let's hope it survives the CI this time.
                
> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Updated] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-5718:
-------------------------------

    Fix Version/s: 2.11.0
                   2.10.3
                   2.9.5

Looking forward for the remainder patches.
                
> Bodies of SUBMIT_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
>             Fix For: 2.9.5, 2.10.3, 2.11.0
>
>         Attachments: camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Updated] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Attachment: test_deliver_sm_bodies_not_mangled.diff

As mentioned before, DELIVER_SM bodies are not mangled, but here is a patch containing tests that confirm the fact in case you think it would be useful.
                
> Bodies of TX 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: camel_smpp_8bit_messages.diff, test_deliver_sm_bodies_not_mangled.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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495965#comment-13495965 ] 

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

I could also have a look, so please let me know if it's necessary.
                
> 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

[jira] [Closed] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller closed CAMEL-5718.
-----------------------------------

    Resolution: Fixed

Thanks again Francois for the patch. It works on my Ubuntu VM too.
                
> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490607#comment-13490607 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

Francois, thanks for the patch. I applied both. Could you please have a look at it, because I had to resolve merge conflicts in both. And a had to do a lot other formatting changes to make Checkstyle happy. You can read more about how you can test it too before you create the patch at [1].

So, thanks again!

[1] http://camel.apache.org/building.html
                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Babak Vahdat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496034#comment-13496034 ] 

Babak Vahdat commented on CAMEL-5718:
-------------------------------------

{quote}
I create a new Ubuntu VM and run the test locally. On my MacOS all tests pass.
{quote}

You can also reproduce the two failing tests even on MacOS:

{code}
mvn test -Dfile.encoding=UTF-16
{code}

That's you change the default platform encoding from {{MacRoman}} to {{UTF-16}}. Unfortunatley I've got no knowledge of the SMPP protocol or jsmpp library but looking at the changes being made by this ticket I see the configured encoding (that's {{SmppConfiguration.getEncoding()}}) [is not taken into the account *anymore*|http://svn.apache.org/viewvc/camel/trunk/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java?r1=1395645&r2=1405775] to build Strings out of the given byte arrays:

{code}
smppMessage.setBody(new String(deliverSm.getShortMessage()));
{code}

which explains why the test results are platform depended!

                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498344#comment-13498344 ] 

Christian Müller commented on CAMEL-5718:
-----------------------------------------

It survived! ;-)
The last camel-smpp tests runs successfully...
                
> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Resolved] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller resolved CAMEL-5718.
-------------------------------------

    Resolution: Fixed
    
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494849#comment-13494849 ] 

Claus Ibsen commented on CAMEL-5718:
------------------------------------

This patch causes 2 failures on our CI servers. Is anybody looking into this?

If not I will revert the commit as it prevent the CI servers from continue testing other parts of Camel.
                
> 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

[jira] [Commented] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480080#comment-13480080 ] 

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

I've also noticed that SUBMIT_SMs with SmppConstants.ALPHABET set to Alphabet.ALPHA_8_BIT have their bodies mangled in the same way.
                
> Bodies of SUBMIT_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
>         Attachments: camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Updated] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Description: 
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 it the RX SMs (DELIVER_SMwere also affected.

  was: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.

    
> 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 it the RX SMs (DELIVER_SMwere 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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495166#comment-13495166 ] 

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

Sorry, I guess you were talking about String.getBytes() doing conversion.

Anyway, I still think the best option would be to set and leave 8-bit bodies as byte[] unless you guys think the difference in types would be a problem? The body really should be left untouched in the case of 8-bit DCS. Otherwise there is just too much scope for things to go wrong.
                
> 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

[jira] [Updated] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Attachment: 8bit_deliver_sm_bodies_mangled.diff
    
> Bodies of TX 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.

--
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

[jira] [Updated] (CAMEL-5718) Bodies of SUBMIT_SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Attachment: camel_smpp_8bit_submit_sm.diff
    
> Bodies of SUBMIT_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
>         Attachments: camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Comment Edited] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496159#comment-13496159 ] 

Francois Kritzinger edited comment on CAMEL-5718 at 11/13/12 1:10 PM:
----------------------------------------------------------------------

I have had a look and I am of the opinion that leaving 8-bit bodies as byte[] is the only solution.

It is not possible to store a byte[] inside a String (using e.g. String.String(byte[])) and read those bytes out again later (using e.g. String.getBytes()) without involving the system's default charset. And as patch [1] shows, this fails (EDIT: fails as in the 8-bit data is modified) on at least one of my system's supported charsets (Big5, in this case). In a nutshell, storing 8-bit data inside a String is just plain wrong.

I don't think consistency (String vs. byte[] bodies) is an issue after all because users will still be able to get a String version of the body by calling SmppMessage.getBody(String.class) (although this will cause conversion on some systems). I think it's actually quite intuitive to retrieve 8-bit data using getBody(byte[].class) or (byte[])getBody().

I have attached two patches. *Note that these patches are not compatible*: patch [1] exists solely to show how I reproduced the CI failures on my machine. The real fix and its unit tests are in patch [2].

[1] _ci_failures_reproduced.diff_: For informational purposes only; modifies the tests that were causing the CI machine to fail so that they fail on my machine. (They should now fail on any machine which supports a reasonable set of character encodings.)

[2] _ci_failures_fixed_and_tested.diff_: The real fix and its unit tests.

                
      was (Author: frankzinger):
    I have had a look and I am of the opinion that leaving 8-bit bodies as byte[] is the only solution.

It is not possible to store a byte[] inside a String (using e.g. String.String(byte[])) and read those bytes out again later (using e.g. String.getBytes()) without involving the system's default charset. And as patch [1] shows, this fails on at least one of my system's supported charsets (Big5, in this case). In a nutshell, storing 8-bit data inside a String is just plain wrong.

I don't think consistency (String vs. byte[] bodies) is an issue after all because users will still be able to get a String version of the body by calling SmppMessage.getBody(String.class) (although this will cause conversion on some systems). I think it's actually quite intuitive to retrieve 8-bit data using getBody(byte[].class) or (byte[])getBody().

I have attached two patches. *Note that these patches are not compatible*: patch [1] exists solely to show how I reproduced the CI failures on my machine. The real fix and its unit tests are in patch [2].

[1] _ci_failures_reproduced.diff_: For informational purposes only; modifies the tests that were causing the CI machine to fail so that they fail on my machine. (They should now fail on any machine which supports a reasonable set of character encodings.)

[2] _ci_failures_fixed_and_tested.diff_: The real fix and its unit tests.

                  
> 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, ci_failures_fixed_and_tested.diff, ci_failures_reproduced.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

[jira] [Updated] (CAMEL-5718) Bodies of TX SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Kritzinger updated CAMEL-5718:
---------------------------------------

    Summary: Bodies of TX SMs with 8-bit data_coding are mangled  (was: Bodies of SUBMIT_SMs with 8-bit data_coding are mangled)
    
> Bodies of TX 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: camel_smpp_8bit_messages.diff, camel_smpp_8bit_submit_sm.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.

--
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

[jira] [Commented] (CAMEL-5718) Bodies of SMs with 8-bit data_coding are mangled

Posted by "Francois Kritzinger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496037#comment-13496037 ] 

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

OK thanks for the help so far guys, I will take a look today still and report back.
                
> 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