From 2b47f07b04bd346539bf10347e72a9a92873120c Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 6 May 2010 16:47:07 -0300 Subject: Charset conversion fixes --- classes/BiblioIsisDb.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'classes/BiblioIsisDb.php') diff --git a/classes/BiblioIsisDb.php b/classes/BiblioIsisDb.php index d7fdd1c..81db3e7 100644 --- a/classes/BiblioIsisDb.php +++ b/classes/BiblioIsisDb.php @@ -90,6 +90,9 @@ class BiblioIsisDb implements IsisDb { // Tag results. $data = $this->tag($results); + // Charset conversion. + array_walk_recursive($data, array(__CLASS__, 'charset')); + // Return the result. return $data; } @@ -184,4 +187,19 @@ class BiblioIsisDb implements IsisDb { } return $value; } + + /** + * Charset conversion. + * + * Converts a string from the database charset to UTF-8. + * + * @param $data + * String to be converted. + * + * @return + * String converted to UTF-8. + */ + function charset(&$data) { + $data = iconv($this->format['db']['charset'], 'UTF-8', $data); + } } -- cgit v1.2.3