From 4b6c8f1cc0c756abee537221b91ee1bc6bfeea43 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 15 Nov 2010 12:11:23 +0000 Subject: [PATCH] Fixed text encoding. --- reporting/includes/class.graphic.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reporting/includes/class.graphic.inc b/reporting/includes/class.graphic.inc index 02af5f2a..30daf8a1 100644 --- a/reporting/includes/class.graphic.inc +++ b/reporting/includes/class.graphic.inc @@ -150,6 +150,7 @@ class graph function graph() { + $this->x = $this->y = $this->z = array(); $this->biggest_x = NULL; @@ -944,6 +945,15 @@ class graph { if ($alt && strlen($string) > 12) $string = substr($string, 0, 12); + + $encoding = $_SESSION['language']->encoding; + if ($encoding != 'UTF-8') { + if (function_exists('iconv')) + $string = iconv($encoding, 'UTF-8', $string); + else + $string = mb_convert_encoding($string, 'UTF-8', $encoding); + } + if ($this->built_in) { imagestring($img, $size, $x, $y + $alt, $string, $col); @@ -965,6 +975,7 @@ class graph // $angle = -15; //else $angle = 0; + imagettftext($img, $size, $angle, $x, $y + $alt, $col, $this->fontfile, $string); } } -- 2.30.2