在国外找了个插件,是通过php连接TEAMSPEAK服务端一个查询端口,然后返回在网页显示的代码,用的是fsockopen ,页面的中文没问题,TS服务端返回的中文就变成乱码了,我不知道是什么问题,请各位牛人帮我看看啊,改哪里才能正常显示中文呢?问题url: http://www.csgo.cn/tsviewer/index.php整个插件的压缩包:http://www.csgo.cn/actsviewer-svn-revision-3.tar.gzclass TS2TCPQuery {
function TS2TCPQuery($srv, $port, $timeout=3) {
//Still missing my exceptions, wanna code Java ;-)
do {
$this->_init();
if (!$this->socket = @fsockopen($srv, $port, $errno, $errstr, $timeout)) {
trigger_error("Unable to connect to TeamSpeak-Server $srv: $errstr", E_USER_WARNING);
break;
}
socket_set_timeout($this->socket, $timeout);
if (!fgets($this->socket) == TS2_SYN) {
trigger_error("$srv:$port does not seem to be a valid TeamSpeak 2 server!");
break;
}
} while(false);
}