Repository: camel
Updated Branches:
  refs/heads/master 9a746ef7c -> 4fa9ef24e


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/eb4300ee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eb4300ee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eb4300ee

Branch: refs/heads/master
Commit: eb4300ee18e0042ee5c857004e326daccfa8bd85
Parents: 9a746ef
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 10:20:25 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/eb4300ee/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
+}

Reply via email to