Problem with binary data

Problem with binary data SearchSearch
Author Message
George Papadopoulos
New member
Username: Odytil

Post Number: 1
Registered: 10-2008
Posted on Saturday, October 25, 2008 - 05:52 pm:   

I have setup the trial version and I am doing some tests. I have create an SMPP gateway. I am sending SMS using a URL of my server and because I use Greek characters I convert them to binary data, I create a binary string of (max) 320 characters (160 text characters) but when I use more than 140 characters (280 hex) on the text box I enter the message, NowSMS splits it to 2 messages and the program sends to the SMPP gateway 2 SMS messages. And the result is to receive garbage on the recipient's phone.

How can I send 160 binary data (because of Greek characters) from the URL I use in onlye one SMS without NOWSMS splits it? I have checked the --Encode text messages with 7-bitpacked encoding-- and the --Encode long text messages with 7-bitpacked encoding-- options on the SMPP gateway advanced options.

An example of the URL I use is http://username:password@127.0.0.1:8800/?PhoneNumber=30XXXXXXXXXX&Data=4444444444&Binary=1&Sender=me&ReceiptReques ted=Yes
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7673
Registered: 10-2002
Posted on Saturday, October 25, 2008 - 10:52 pm:   

Hi George,

The problem is that you're converting it to binary data.

A binary message is limited to 140 bytes of data.

And it's going to turn out as garbage unless you set the DCS correctly.

Not to mention ... when you convert the text to binary, what conversion are you using? There is also the concept of using Unicode encoding for non-Latin languages, but in a Unicode message you are limited to 70 characters per message.

Here's a posting that talks more about these limits, and the various character encodings:

http://blog.nowsms.com/2007/06/long-sms-text-messages-and-160.html

NowSMS actually handles Greek text pretty well. And there are a lot of Greek characters that are part of the 7-bit character set of GSM, so that you can use standard text encoding. (And there are some other Greek characters that are officially different from Latin characters, but are close enough that NowSMS automatically converts them so that you are not forced to use Unicode.)

This link will show you what characters can be used in a standard GSM text message:

http://support.nowsms.com/discus/messages/1/1103.html

But don't convert the text to binary data!

Here's what I'd suggest ...

First, experiment with sending the text that you want to send via the NowSMS web interface. The NowSMS web interface uses UTF-8 encoding, so any text you enter into the web form will get submitted to NowSMS using UTF-8. NowSMS will then examine the text to see if it can encode it using the GSM charater set (160 character limit per message), or if it cannot, it will encode the message using Unicode (70 character limit per message).

By default, the NowSMS server expects to receive text encoded in UTF-8 format.

However, you can use Greek (or any other local language) without converting to UTF-8, as long as you include an "&charset=xxxx" parameter in the URL to tell NowSMS what character set you are using.

In the case of Greek text, I believe you can simply add "&charset=greek" to the URL. NowSMS consults the Windows registry for character set encoding information, and "greek" is usually pre-defined in Windows as an alias for "iso-8859-7". Or to play it safe, explicitly specify "&charset=iso-8859-7" ... that will tell NowSMS that the text parameter you are submitting consists of Greek text.

-bn
George Papadopoulos
New member
Username: Odytil

Post Number: 2
Registered: 10-2008
Posted on Monday, November 03, 2008 - 08:42 pm:   

I tried the method you are saying with the "&charset=iso-8859-7" and I am sending the message with the "&Text" parameter but NOWSMS splits it in 3 messages, and I want to avoid it. I want NOWSMS to send it in only 1 sms. How can I manage it?
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7674
Registered: 10-2002
Posted on Monday, November 03, 2008 - 08:52 pm:   

Hi George,

Can you please supply the exact text that you are try to send?

Also, refer to the GSM character set table in the following link:

http://support.nowsms.com/discus/messages/1/1103.html

If you use ANY characters in your message that are not in the GSM character set, then your message must be sent in Unicode format, which has a 70 character limit.

If you only use characters in the GSM character set, then you are subject to the 160 character limit.

The "Send Text Message" web form in the NowSMS web interface is helpful in this regard as you can type your text into that form, and it will tell you if you are using Unicode characters. I'm not saying that you need to use this web form to send messages ... I'm saying that it may be helpful for you to determine what characters are a problem in your example if you have trouble understanding the table that I'm referring you to in that other message.

-bn
George Papadopoulos
New member
Username: Odytil

Post Number: 3
Registered: 10-2008
Posted on Monday, November 03, 2008 - 08:58 pm:   

You have right. I was using Greek small letter and not capital letters. I will create a function that will convert small Greek characters to capital and the problem will be solved.
George Papadopoulos
New member
Username: Odytil

Post Number: 4
Registered: 10-2008
Posted on Monday, November 03, 2008 - 08:59 pm:   

Thank you very much for your help. I appreciate a lot your help. How did I missed that, I can;t understand.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 7677
Registered: 10-2002
Posted on Tuesday, November 04, 2008 - 02:50 am:   

No worries ... this can be confusing, especially for the Greek language where some letters are present and some are not!

Your response actually should help explain this for future questions regarding Greek text. Upper case greek letters are generally part of the GSM character set (or close enough that NowSMS can translate to a Latin look-alike). But lower case (small) Greek letters are not part of the GSM character set, and those require Unicode encoding in order to be sent out.


-bn