Convert string to UTF-8
-
Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:
http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl
MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution
SendGSM.send_sms(utfCodes);
Dabsukol
-
Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:
http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl
MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution
SendGSM.send_sms(utfCodes);
Dabsukol
"no SMS received" means -> the error is not always in your side. The error maybe in receiver server, probably the server cannot receive arabic font. If you send the sms, and you get no error, then you must see at SMS server. Without error text, it will be impossible to find the error.
-
Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:
http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl
MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution
SendGSM.send_sms(utfCodes);
Dabsukol
try this: byte[] utfCodes = System.Text.Encoding.Default.GetBytes(sMessage);
-
try this: byte[] utfCodes = System.Text.Encoding.Default.GetBytes(sMessage);
byte[] utfCodes = System.Text.Encoding.Default.GetBytes(sMessage); byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage);
Rajesh B --> A Poor Workman Blames His Tools <--
-
Hi, I have a webservice that send bulk SMS and it works for English language. The problem is when users send SMS using ARABIC text no SMS is receieved. Please help me to improve or change my code so it will work for arabic characters. I think the problem is when converting the string to UTF-8 code. MY Webservice:
http://10.45.98.198:8080/Script/SMSArabicEnglish.jws?wsdl
MY C# Code that send the message to my webservice. string sMessage = وقت البلاغ:" ; byte[] utfCodes = System.Text.Encoding.UTF8.GetBytes(sMessage); //second solution
SendGSM.send_sms(utfCodes);
Dabsukol
Why don't you just pass the string to web-service rather than passing byte array?
Best wishes, Navaneeth
-
Why don't you just pass the string to web-service rather than passing byte array?
Best wishes, Navaneeth