CAMEL-7224 Fixed the camel-smpp fails to correctly send messages that require UCS-2 encoding with thanks to Daniel
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f129e299 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f129e299 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f129e299 Branch: refs/heads/camel-2.13.x Commit: f129e2990963ce27a96b0dc1f91430e08456b4d2 Parents: f5ddae7 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Fri Nov 7 10:20:25 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Fri Nov 7 11:08:07 2014 +0800 ---------------------------------------------------------------------- .../java/org/apache/camel/component/smpp/SmppSmCommand.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/f129e299/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java ---------------------------------------------------------------------- diff --git a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java index 522ffad..175ac9c 100644 --- a/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java +++ b/components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppSmCommand.java @@ -85,8 +85,10 @@ public abstract class SmppSmCommand extends AbstractSmppCommand { } private Charset determineCharset(byte providedAlphabet, byte determinedAlphabet) { - if (providedAlphabet == SmppConstants.UNKNOWN_ALPHABET && determinedAlphabet == Alphabet.ALPHA_UCS2.value()) { - return Charset.forName(SmppConstants.UCS2_ENCODING); // change charset to use multilang messages + if (providedAlphabet == Alphabet.ALPHA_UCS2.value() + || (providedAlphabet == SmppConstants.UNKNOWN_ALPHABET && determinedAlphabet == Alphabet.ALPHA_UCS2.value())) { + // change charset to use multilang messages + return Charset.forName(SmppConstants.UCS2_ENCODING); } return charset; @@ -110,4 +112,4 @@ public abstract class SmppSmCommand extends AbstractSmppCommand { return alphabetObj; } -} \ No newline at end of file +}