之所有存在乱码,时因为GD图表中,默认的字体gdTinyFont/gdSmallFont不支持中文;将字体库改就可以了,这里我使用了windows的"微软雅黑"替代;方法如下:
1:去windows字体库中找MSYH.TTF,直接拷贝到bugzilla中;
2:
>>pie中乱码(/var/www/html/bugzilla/lib/GD/Graph/pie.pm)
1:去windows字体库中找MSYH.TTF,直接拷贝到bugzilla中;
2:
>>pie中乱码(/var/www/html/bugzilla/lib/GD/Graph/pie.pm)
$self->set_value_font(gdTinyFont);
$self->set_label_font(gdSmallFont);
改成:
$self->set_value_font('./fonts/MSYH.TTF');
$self->set_label_font('./fonts/MSYH.TTF');
>>坐标等乱码(/var/www/html/bugzilla/lib/GD/Graph/axestype.pm)
$self->set_x_label_font(GD::gdSmallFont);
$self->set_y_label_font(GD::gdSmallFont);
$self->set_x_axis_font(GD::gdTinyFont);
$self->set_y_axis_font(GD::gdTinyFont);
$self->set_legend_font(GD::gdTinyFont);
$self->set_values_font(GD::gdTinyFont);
改成:
$self->set_x_label_font('./fonts/MSYH.TTF');
$self->set_y_label_font('./fonts/MSYH.TTF');
$self->set_x_axis_font('./fonts/MSYH.TTF');
$self->set_y_axis_font('./fonts/MSYH.TTF');
$self->set_legend_font('./fonts/MSYH.TTF');
$self->set_values_font('./fonts/MSYH.TTF');