i wrote an article on exactly how i got chinese SMSes running on a
local server here:
http://chipmunkninja.com/article/kannelsetup
Your code looks ALMOST the same as mine, except for that mysql_iconv
function call -- why not just use regular iconv() ???
m.
On 7/18/07, Peter Lum <[EMAIL PROTECTED]> wrote:
Hi
Thanks for all the suggestions but I am still facing the same problems..
Garbage in the sms.
Must I do something on the Kannel server side?
My PHP file are set to:
Unicode (UTF-8)
Include BOM
Unicode Normalisation Form: Compatibility Decomposition.
My PHP code:
$kannelhost = 'http://' . $CONFIG_KANNEL_HOST . ':' . $CONFIG_KANNEL_PORT;
$ucs2text = mysql_iconv($in_msg, 'utf-8', 'ucs-2' );
$url = "/cgi-bin/sendsms?username=" . $CONFIG_KANNEL_USER_NAME
. "&password=" . $CONFIG_KANNEL_PASSWORD
. "&charset=UCS-2&coding=2"
. "&to=$in_phoneNumber"
. "&text=" . urlencode( $ucs2text )
. "&dlr-mask=19";
print "full url=". $kannelhost . $url;
$results = file($kannelhost . $url);
Also, how do you keep everything in utf-8?
Thanks and hope someone would shed more light in this matter.
Thanks!
Peter
-----Original Message-----
From: Franco Mattarini [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 17, 2007 10:16 PM
To: [email protected]
Subject: Re: Chinese SMS
Hello Peter
I've managed to do this after trying for a little while. I sent the
messages as Unicode (UCS2).
UCS2 is a double byte character encoding, whereas UTF-8 is a single byte
one. UTF-16 is also double byte and I found that when I converted it to
UTF-16 first, kannel could properly convert it.
You might find your message has a little square character at the beginning
and the rest is OK. This will probably a Byte Order Mark (BOM). I used
Python, which puts this in and I had explicitly remove it. It looks like
you're using PHP and I don't know if that does it or not.
Hope this helps, good luck.
Franco
EDIT: I also used that coding (coding=2) but added charset=ucs-2
--
View this message in context:
http://www.nabble.com/SMSC-tf4090512.html#a11645544
Sent from the Kannel - User mailing list archive at Nabble.com.