Hello Alt!
When we send special characters in messages, they do not come properly. Ex: ? appears as some other alphabets. Please help me to solve this problem
Thanks!
Special characters
Moderator: alt
Re: Special characters
Where "?" appears? On mobile phone or in application?
What data_coding do you use?
What data_coding do you use?
Re: Special characters
Hello!
If i send a message "How r u ?" , i do not receive question mark on mobile. Instead it gives A and pound sign.
I am using default encodong.
Rest of the special characters come properly after using the GSMEncode function. The problem is only with ?
Please help
The GSMEncode function is as follows taken from one of the posts:
public static byte[] GSMEncode(string PlainText)
{
// ` is not a conversion, just a untranslatable letter.
// x0D should be CR but this causes double linefeed on
// some phones so has been removed.
const string strGSMTable =
"@?$???????\n??`??" +
"Δ_ΦΓΛΩΠΨΣΘΞ`????" +
" !\"#¤%&'()*+,-./" +
"0123456789:;<=>?" +
"?ABCDEFGHIJKLMNO" +
"PQRSTUVWXYZ????§" +
"?abcdefghijklmno" +
"pqrstuvwxyz?????";
const string strExtendedTable =
"````````````````" +
"````^```````````" +
"````````{}`````\\" +
"````````````[~]`" +
"|```````````````" +
"````````````````" +
"`````?``````````" +
"````````````````";
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
foreach (char cPlainText in PlainText.ToCharArray())
{
if (cPlainText != '`') // Ignore `
{
int intGSMTable = strGSMTable.IndexOf(cPlainText);
if (intGSMTable != -1)
{
ms.WriteByte((byte)intGSMTable);
continue;
}
int intExtendedTable = strExtendedTable.IndexOf(cPlainText);
if (intExtendedTable != -1)
{
ms.WriteByte(27);
ms.WriteByte((byte)intExtendedTable);
}
}
}
ms.Close();
return ms.ToArray();
}
}
Please help!
Thanks in advance
If i send a message "How r u ?" , i do not receive question mark on mobile. Instead it gives A and pound sign.
I am using default encodong.
Rest of the special characters come properly after using the GSMEncode function. The problem is only with ?
Please help
The GSMEncode function is as follows taken from one of the posts:
public static byte[] GSMEncode(string PlainText)
{
// ` is not a conversion, just a untranslatable letter.
// x0D should be CR but this causes double linefeed on
// some phones so has been removed.
const string strGSMTable =
"@?$???????\n??`??" +
"Δ_ΦΓΛΩΠΨΣΘΞ`????" +
" !\"#¤%&'()*+,-./" +
"0123456789:;<=>?" +
"?ABCDEFGHIJKLMNO" +
"PQRSTUVWXYZ????§" +
"?abcdefghijklmno" +
"pqrstuvwxyz?????";
const string strExtendedTable =
"````````````````" +
"````^```````````" +
"````````{}`````\\" +
"````````````[~]`" +
"|```````````````" +
"````````````````" +
"`````?``````````" +
"````````````````";
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
foreach (char cPlainText in PlainText.ToCharArray())
{
if (cPlainText != '`') // Ignore `
{
int intGSMTable = strGSMTable.IndexOf(cPlainText);
if (intGSMTable != -1)
{
ms.WriteByte((byte)intGSMTable);
continue;
}
int intExtendedTable = strExtendedTable.IndexOf(cPlainText);
if (intExtendedTable != -1)
{
ms.WriteByte(27);
ms.WriteByte((byte)intExtendedTable);
}
}
}
ms.Close();
return ms.ToArray();
}
}
Please help!
Thanks in advance