Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8A4A10FD7 for ; Tue, 18 Feb 2014 13:38:28 +0000 (UTC) Received: (qmail 41207 invoked by uid 500); 18 Feb 2014 13:38:28 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 40696 invoked by uid 500); 18 Feb 2014 13:38:24 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 40344 invoked by uid 99); 18 Feb 2014 13:38:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 13:38:20 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [195.8.117.5] (HELO mail1.trendhosting.net) (195.8.117.5) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 13:38:15 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.trendhosting.net (Postfix) with ESMTP id 87404152EA for ; Tue, 18 Feb 2014 13:37:53 +0000 (GMT) Received: from mail1.trendhosting.net ([127.0.0.1]) by localhost (thp003.trendhosting.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BYYGLgDcEtjs for ; Tue, 18 Feb 2014 13:37:51 +0000 (GMT) Message-ID: <5303622E.8030907@pocock.pro> Date: Tue, 18 Feb 2014 14:37:50 +0100 From: Daniel Pocock User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: dev@camel.apache.org Subject: camel-smpp UCS-2 issues X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I've observed some oddities sending messages to SMPP that require UCS-2 (16 bit / Unicode) encoding To make it work, I have to explicitly set: alphabet=-1 in the endpoint config CamelSmppDataCoding=8 in the exchange headers and leave other headers and config settings empty/default Automatic detection of encoding doesn't seem to work, so I have to scan each message myself and then make those settings when necessary on a per-message basis. Given alphabet=-1 in the endpoint config, I also have to explicitly set CamelSmppAlphabet= ALPHA_DEFAULT for those messages that don't require UCS-2 treatment I made a quick review of the code and various things caught my eye: - the header Exchange.CHARSET_NAME is never checked, it could be more useful than the "encoding" param in the endpoint config perhaps? - in SmppSmCommand: why does determineCharset() only return UCS2_ENCODING for UNKNOWN_ALPHABET and not for ALPHA_UCS2? why does determineAlphabet() only use the charset configured in the endpoint? This seems like a good place to use Exchange.CHARSET_NAME