JPGraph中文乱码问题
上一篇 / 下一篇 2008-11-27 10:41:57 / 个人分类:配置
(~OT0MfS0jpgraph处理有中文字符时都会转成utf8编码后显示,我们只需注释掉相关的代码就可以了。51Testing软件测试网3E*Vf t&u;l
W!A:q1EvR po0dotproject苷特图中文乱码解决具体步骤如下:
(b CXXv051Testing软件测试网 gr@2]G X-[$?(X B1。修改jpgraph库51Testing软件测试网 U'n6iG'g2oE%^Q
51Testing软件测试网a#pZ9f4@ ue打开dotproject \lib\jpgraph\jpgraph\src\jpgraph.php文件,找到下面代码段
;F$Y_'pH6mf0O}051Testing软件测试网X4Z~A,o+U NV function convert($atxt,$aff) {51Testing软件测试网4p6P1S)bYw#@
if( language_cyrillic ) {
(CwG"zA&I6~l0 if( cyrillic_from_windows ) {51Testing软件测试网/H!E7U#{B6F4Z
$atxt = convert_cyr_string($atxt, "w", "k");51Testing软件测试网|K(PE_b
}
L{wHqQ0 $isostring = convert_cyr_string($atxt, "k", "i");51Testing软件测试网@q3sA%I{ x
$unistring = languageconv::iso2uni($isostring);
2g`D9JB'bP0 return $unistring;51Testing软件测试网(k^.Ju]
}/* 注释掉下面代码段51Testing软件测试网ZE}{:\&fp
elseif( $aff === ff_simsun ) {51Testing软件测试网-c6cheM)oA1]5a
// do chinese conversion51Testing软件测试网1{M `CQ `k"zf2S
if( $this->g2312 == null ) {51Testing软件测试网EAM\nR;H-K
include_once 'jpgraph_gb2312.php' ;51Testing软件测试网x/HQ3q#G"s"~Y
$this->g2312 = new gb2312toutf8();
*m7q&ve2XN0 }51Testing软件测试网{/g,e&k`j#B
return $this->g2312->gb2utf8($atxt);51Testing软件测试网:V1l!G1];`y
}51Testing软件测试网2nI-iK2z*[
elseif( $aff === ff_chinese ) {51Testing软件测试网#AH.?8N.N)X
if( !function_exists('iconv') ) {
Y0f3Om3n!r0 jpgrapherror::raise('usage of ff_chinese (ff_big5) font family requires that your php setup has the iconv() function. by default this is not compiled into php (needs the "--width-iconv" when configured).');
PGt'jh)M1Yu0 }51Testing软件测试网jZ'?Lh+[J$@
return iconv('big5','utf-8',$atxt);
#a9Q}BT&e
@5\0 }注释到此结束*/51Testing软件测试网)t8P*U Ty$K
else51Testing软件测试网b'LYOFo4c2f
return $atxt;
fVV9Ly:g.n"J0 }
2.修改dotproject中用到jpgraph的模块51Testing软件测试网2Sh B[1A-]k
51Testing软件测试网~5T%tV_n$_bd:ya. 改project模块51Testing软件测试网tyI/~^.u
IJF&c