Hi Mark,

You might find it safer to check if any characters in your String are
*not* in the GSM 7bit characterset.

Alex

On Nov 3, 1:43 am, Mark Thien <[email protected]> wrote:
> Thanks Thanasis, I have change to the following and it works now:
>
>                 String str = "some chinese character";
>                 // check if message contain unicode character
>                 boolean containUnicodeChar = false;
>
>                 for(int x = 0; x < str.length(); x++){
>                      String unicode = CharUtils.unicodeEscaped(str.charAt
> (x));
>                      unicode = unicode.substring(2, unicode.length());
>
>                      if(unicode.charAt(0) != '0' || unicode.charAt(1) != '0')
> {
>                         containUnicodeChar = true;
>                         break;
>                      }
>                 }
>
>                 if(containUnicodeChar){
>                       msg.setEncoding(MessageEncodings.ENCUCS2);
>                 }
>
> On Nov 1, 4:43 pm, Thanasis <[email protected]> wrote:
>
>
>
> > Hi,
>
> > I think its wrong to try and send your unicode message as a binary messages.
> > Use the normal OutboundMessage smslib class and set its encoding to UCS2.
>
> > 2009/10/31 Mark Thien <[email protected]>
>
> > > Hi guys,
>
> > >    I am using the ClickatellHTTPGateway to try to send Chinese
> > > characters as follow:
>
> > > Set <OutboundMessage>set = new LinkedHashSet<OutboundMessage>();
> > > OutboundBinaryMessage outboundBinaryMessage = new OutboundBinaryMessage
> > > ("+6591177135", "some chinese character here".getBytes());
> > > outboundBinaryMessage.setId("0123456789");
> > > outboundBinaryMessage.setFrom("Menggaris");
> > > set.add(outboundBinaryMessage);
> > > srv.queueMessages(set);
>
> > > and some how it just failed to send. Appreciate if anyone could advice
> > > on this issue. Thanks !
>
> > > kind regards,
> > > Mark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SMSLib for Java User Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/smslib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to