URL escaping not going well.

URL escaping not going well. SearchSearch
Author Message
kojuh
New member
Username: Devil_dog

Post Number: 7
Registered: 11-2005
Posted on Tuesday, January 17, 2006 - 09:36 am:   

i have entered in my application..
temp = Replace(temp, "&", "%26")
temp = Replace(temp, "+", "%2B")
temp = Replace(temp, "%", "%25")
temp = Replace(temp, "#", "%23")
temp = Replace(temp, "=", "%3D")

where temp is the text of the message.
i make my application to GET the url as described by the nowsms documentation.
almost everything is fine except that in my message in the Cellphone i get a %26 where i should get a &...
am i doing something wrong?

i am connecting to nowsms using http GET and nowsms is connecting to the SMSC using SMPP
kojuh
New member
Username: Devil_dog

Post Number: 9
Registered: 11-2005
Posted on Wednesday, January 18, 2006 - 03:26 am:   

very strange,

not sms with escaped characters are sent as bibary for example i submit the following SMS to nowsms:-

test SMS with a %0f in the text

from the SMPP log of this SMS :-

2006-01-18 11:16:15,43CCF4F5.req,127.0.0.1,66xxxx,OK -- SMPP - xxx.xxx.xx.6:77xx,Sender=66xxxx;SMSCMsgId=1xx70xx1184xx;Binary=1;DCS=8;Data=0074 00650073007400200053004D005300200077006900740068002000610020000F00200069006E0020 00740068006500200074006500780074

the message displayed on my phone :-

test SMS with a in the text.

now does the presence of special characters make nowsms believe it is unicode?
Any work around?

having the same problem if submitting manually using the escaped text sending directly from the address bar of the web browser, so we are sure not a bug in my app.
kojuh
New member
Username: Devil_dog

Post Number: 10
Registered: 11-2005
Posted on Wednesday, January 18, 2006 - 08:36 am:   

submiting from the NowSMS web form works fine....
the SMPP log for this entry.

2006-01-18 16:27:04,43CCF519.req,127.0.0.1,66xxxxx,OK -- SMPP - 2xx.2xx.xx0.x:7xxx,Sender=xxx;SMSCMsgId=xxxxxxxxx;Text="submitting a text with a ? inside the text...."


strange. does this mean the http API of NowSMS is acting up or is it that i am missing something.

is there any other way my application (runing on same computer as nowsms) can send comunicate with now sms?
kojuh
New member
Username: Devil_dog

Post Number: 12
Registered: 11-2005
Posted on Thursday, January 19, 2006 - 04:08 pm:   

help...support....anyone?

Nowsms is treating messages with ? as binary and sometimes messages with size < 160 is being split into 2 messages and im being charged double,,,'
help...loosing money...
kojuh
New member
Username: Devil_dog

Post Number: 13
Registered: 11-2005
Posted on Friday, January 27, 2006 - 02:22 pm:   

?
Bump
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 5452
Registered: 10-2002
Posted on Friday, January 27, 2006 - 04:15 pm:   

Hi Kojuh,

I don't know what HTTP library you are using. It sounds like that library might already be doing some of the escaping on your behalf. (Hence if you escape "&" to "%26", it might further escape this to "%2526", which NowSMS will unescape back to "%26".)

My suggestions would be this ...

1.) Check the documentation for the HTTP libraries or interface that you are using, and see what the mention about URL escaping.

2.) Do some experiments to see what the raw request looks like that is coming in from your application to NowSMS, so that you can adjust it accordingly. The easiest way to do this is to enable the SMSDEBUG.LOG (see checkbox on "Serial #" page). You will see the raw HTTP GET request logged here.

-bn
kojuh
New member
Username: Devil_dog

Post Number: 14
Registered: 11-2005
Posted on Saturday, January 28, 2006 - 02:44 pm:   

Hi Bryce,

your reply made me think and i realised it was a bug in my code, i was escaping ? with %0f instead of %3f and hence all the confusion and some loss of revenue for me.

Thanks a lot for your support, its working well now.