Skip to content

Instantly share code, notes, and snippets.

@false-git
Created June 15, 2013 22:58
Show Gist options
  • Save false-git/5789901 to your computer and use it in GitHub Desktop.
Save false-git/5789901 to your computer and use it in GitHub Desktop.
zabbix2 のグラフの文字化け対策
*** graphs.inc.php.orig Sat Jun 15 23:17:46 2013
--- graphs.inc.php Sun Jun 16 07:54:35 2013
***************
*** 666,671 ****
--- 666,674 ----
imagettftext($image, $fontsize, $angle, $x, $y, $color, $ttf, $string);
}
elseif ($angle == 0) {
+ if ($gdinfo['JIS-mapped Japanese Font Support']){
+ $string = mb_convert_encoding($string, "SJIS", "UTF-8");
+ }
$ttf = ZBX_FONTPATH.'/'.ZBX_GRAPH_FONT_NAME.'.ttf';
imagettftext($image, $fontsize, $angle, $x, $y, $color, $ttf, $string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment