我正在使用SMPP Receiver API从特定的MSISDN获取消息。我正确地获取英文文本。但Dari和Pashto文本格式不相同。它显示输出象下面这样:
/
'2(
/' HFD/1
我的代码是:SMPP接收器不支持Unicode文本
ob_start();
require_once "smpp.php";//SMPP protocol
//connect to the smpp server
$tx=new SMPP('IP',PORT);
//bind the receiver
$tx->system_type="NUll";
$tx->addr_npi=0;
$tx->bindReceiver("username","password");
do
{
//read incoming sms
if($sms=$tx->readSMS())
{
print_r($sms);
}
}while($sms);
而smpp.php是:
http://121.100.50.58/apps/smpp/
如何才能获得正确的Dari和Pashto语言消息文本?
嘿@biplav,仍然有同样的问题。 –
@SushilKandola:你在哪里看到输出?它是在telnet上还是什么的,它可能不符合utf8。你可以把它写入一个文件,并用支持Utf8的编辑器打开。 – biplav
是的,我也写过这个文件,但格式相同。即使我将数据插入到sql数据库,它也支持UTF-8。 –