JPGraph中文乱码问题
上一篇 / 下一篇 2008-11-27 10:41:57 / 个人分类:配置
jpgraph处理有中文字符时都会转成utf8编码后显示,我们只需注释掉相关的代码就可以了。
X(F#hU+w]I t6C051Testing软件测试网 Zv]3wR?%Pj'jfdotproject苷特图中文乱码解决具体步骤如下:51Testing软件测试网o1J*T\-oRoh-C
;D#L5z^*j'l01。修改jpgraph库
z~/{VcKD04k!k/| t(W2k(Z6X0打开dotproject \lib\jpgraph\jpgraph\src\jpgraph.php文件,找到下面代码段51Testing软件测试网ud}SF
51Testing软件测试网1Ax!{~n function convert($atxt,$aff) {51Testing软件测试网%[
vQ5LC9k\
if( language_cyrillic ) {51Testing软件测试网l9Bq
w?$_ kI t,N
if( cyrillic_from_windows ) {51Testing软件测试网W'D PLUp;Ye
$atxt = convert_cyr_string($atxt, "w", "k");51Testing软件测试网2G*j2Vl\V
`
}51Testing软件测试网:fk8N7~*m5f3O-\
$isostring = convert_cyr_string($atxt, "k", "i");
&DE+~t8GNw0 $unistring = languageconv::iso2uni($isostring);51Testing软件测试网
FEh6G+zCg,E
return $unistring;
(dO/Z;R [(G0 }/* 注释掉下面代码段
2P*Yh8aG"w"^0 elseif( $aff === ff_simsun ) {
ol5{4G g4m&z0 // do chinese conversion
#AUO/Dj$~uI9R0 if( $this->g2312 == null ) {
2p5tMb_t0 include_once 'jpgraph_gb2312.php' ;
*NH(e5\u:},B)dpB0 $this->g2312 = new gb2312toutf8();51Testing软件测试网F*[M$S3rd
}
/?%t/uP9s#ZE boZ0 return $this->g2312->gb2utf8($atxt);51Testing软件测试网m[`-A"dJ,?r:O
}51Testing软件测试网GUn*\DjZ:F
elseif( $aff === ff_chinese ) {51Testing软件测试网c"UO"C*J L6Q
if( !function_exists('iconv') ) {51Testing软件测试网o9sQ3vjK6o%c(k
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).');
a1}[Y.Jb
Pfp0 }51Testing软件测试网A:H'iY[&o
n J2HM
return iconv('big5','utf-8',$atxt);51Testing软件测试网-Sz)gV6qz
}注释到此结束*/
4mV&BQ_R0pD4F
F0 else51Testing软件测试网4G Qdas"C
return $atxt;51Testing软件测试网FDbPo
q
}
,B%q]W\.O\J02.修改dotproject中用到jpgraph的模块51Testing软件测试网&L