jackyshow 发表于 2010-9-15 21:44:23

这是啥编码??

本帖最后由 jackyshow 于 2010-9-16 01:27 编辑

谁知道这是啥编码???

& # x 7 F 5 1 ; (网)---中间没空格,直接发布的话浏览器会直接转换 看不到
w(w)

括号里是对应的字符,其实就是51la的关键词编码,搞了半天没搞清楚什么编码。。。想抓取。。以下是插件函数,貌似不起作用
function str_from_unicode($str, $out_charset = 'gbk'){
$str = preg_replace_callback("|&#({1,5});|", 'unicode2utf8_', $str);
$str = iconv("UTF-8", $out_charset, $str);
return $str;
}
function unicode2utf8_($c){
return unicode2utf8($c);
}
function unicode2utf8($c){
$str="";
if ($c < 0x80) {
$str.=$c;
} else if ($c < 0x800) {
$str.=chr(0xC0 | $c>>6);
$str.=chr(0x80 | $c & 0x3F);
} else if ($c < 0x10000) {
$str.=chr(0xE0 | $c>>12);
$str.=chr(0x80 | $c>>6 & 0x3F);
$str.=chr(0x80 | $c & 0x3F);
} else if ($c < 0x200000) {
$str.=chr(0xF0 | $c>>18);
$str.=chr(0x80 | $c>>12 & 0x3F);
$str.=chr(0x80 | $c>>6 & 0x3F);
$str.=chr(0x80 | $c & 0x3F);
}
return $str;
}

jackyshow 发表于 2010-9-15 21:52:22

(网)的unicode编码应该是 & # 3 2 5 9 3 ;吧。。。

jackyshow 发表于 2010-9-16 01:27:33

已搞定,是十六进制编码格式!谢谢路过的。。。
页: [1]
查看完整版本: 这是啥编码??