JPGraph中文乱码问题

王朝other·作者佚名  2006-01-09
宽屏版  字体: |||超大  

JPGraph处理有中文字符时都会转成utf8编码后显示,我们只需注释掉相关的代码就可以了。

Dotproject苷特图中文乱码解决具体步骤如下:

1。修改jpgraph库

打开dotproject \lib\jpgraph\jpgraph\src\jpgraph.php文件,找到下面代码段

function Convert($aTxt,$aFF) {

if( LANGUAGE_CYRILLIC ) {

if( CYRILLIC_FROM_WINDOWS ) {

$aTxt = convert_cyr_string($aTxt, "w", "k");

}

$isostring = convert_cyr_string($aTxt, "k", "i");

$unistring = LanguageConv::iso2uni($isostring);

return $unistring;

}/* 注释掉下面代码段

elseif( $aFF === FF_SIMSUN ) {

// Do Chinese conversion

if( $this->g2312 == null ) {

include_once 'jpgraph_gb2312.php' ;

$this->g2312 = new GB2312toUTF8();

}

return $this->g2312->gb2utf8($aTxt);

}

elseif( $aFF === FF_CHINESE ) {

if( !function_exists('iconv') ) {

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).');

}

return iconv('BIG5','UTF-8',$aTxt);

}注释到此结束*/

else

return $aTxt;

}

2.修改dotproject中用到jpgraph的模块

a. 改project模块

打开dotproject\modules\projects\gantt.php文件,修改文件中下面的代码

将所有

arialbd.ttf

simsum.ttc

替换

将所有

FF_ARIAL

FF_SIMSUN

替换

注释掉下面的代码

//if ( $locale_char_set=='utf-8' && function_exists("utf8_decode") ) {

// $name = utf8_decode($name);

//}

b.同理修改dotproject\modules\tasks\gantt.php文件

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有