tags:

views:

44

answers:

2

Hi Guys, I'm using sms1.cardboardfish.com to sens smses through the web. I have these datacoding schemes to work with: 0: Flash 1: Normal 2: Binary 4: UCS2 5: Flash UCS2 6: Flash GSM 7: Normal GSM and I want to send it in hebrew. right now I'm sending it in 7: Normal GSM and it comes out scrambled.. Ideas anyone?

+4  A: 

Send it in UCS2, which is normal UTF-16 encoding.

I think this should do the trick:

>>> a=u"שלום"
>>> a
u'\u05e9\u05dc\u05d5\u05dd'
>>> a.encode("utf_16_be").encode("hex")
'05e905dc05d505dd'
adamk
Do you know how to send ucs2 hex in url?
apple_pie
I Edited my answer - see if this helps.
adamk
unbelievable.. It works thanks, I tried all sorts of things and this is the simplest
apple_pie
+2  A: 

Note that when using a multi-byte character set (such as UCS2) the maximum number of characters per message will be significantly reduced. The well known 160 character limit is based on a 7 bit character set, with a 16 bit character set you'll be limited to 70 characters.

Victor Welling
How do I convert a python string to ucs2 hex (which I need to send in url)
apple_pie