• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Special ASCII characters will cause sms to be truncated

Started by weggin, June 29, 2010, 12:26:21 pm

Previous topic - Next topic

weggin

Hi roman:

I have a question about sms truncate.
When i edit SMS content, keyin Special ASCII characters like '\n' $ % & * / ( ) etc.
It will truncate the sms, and the total sms length will less than 70 characters.
Some SMS Web sending platform could translate these Special ASCII characters('\n', 2010 '/' 06 '/' 30 ), and it work well.
Because i need use some special character (like 2010/06/30, '\n') in my SMS content.
Could you resolve this problem? thanks!

Roman Novgorodov

Hello

I think you can ESCape needed chars by StringReplace() function before send string with sms text.

Sorry possible I don't understand you. Can you show sample source code?

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

weggin

Quote from: weggin on June 29, 2010, 12:26:21 pm
Hi roman:

I have a question about sms truncate.
When i edit SMS content, keyin Special ASCII characters like '\n' $ % & * / ( ) etc.
It will truncate the sms, and the total sms length will less than 70 characters.
Some SMS Web sending platform could translate these Special ASCII characters('\n', 2010 '/' 06 '/' 30 ), and it work well.
Because i need use some special character (like 2010/06/30, '\n') in my SMS content.
Could you resolve this problem? thanks!



void __fastcall TForm1::Button2Click(TObject *Sender)
{
     AnsiString as, DateString;
     WideString strtemp;
     TStringStream *SS = new TStringStream(strtemp);
     
     as = IdHTTP1->Get("URL");
     DateString = Now().DateString();  // get 2010/06/30 string
     SS->WriteString(DateString);
     SS->WriteString(" ");
     SS->WriteString("Paris");
     SS->WriteString("_");
     FetchWeather(as, "Paris");  //call FetchWeather(AnsiString resp, AnsiString str) 
       //to get weather data from a url page,and add into SS by SS->WriteString(xx);
     
     SS->WriteString("\n");
     FetchHumidity(as, "Paris");//get humidity data
     SS->WriteString("\n");
     FetchTemperature(as, "Paris");//get temperature data     
       
     nrGsm1->SmsSend("+712234234", SS->DataString, true);
}
//the SMS total length is about 68 characters:2010/06/30 Paris_weather:Mostly sunny\n humidity:30%\ntemperature:80.6F
when i receive ths sms,the end of the content is cutting off.
It may become like this(2010/06/30 Paris_weather:Mostly sunny\n humidity:30)