diff options
author | Silvio <silvio@devlet.com.br> | 2010-04-01 13:59:55 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-04-01 13:59:55 -0300 |
commit | 0e67880b97909c08021ef5fa1075082cfc9b6e26 (patch) | |
tree | 8bc75fbff2a87c2fa8718d6b36bd29e6687c05c9 /classes/PhpIsisDb.php | |
parent | 0bfdde221663dae880797b74da45e2f66a4caada (diff) | |
download | cinisis-0e67880b97909c08021ef5fa1075082cfc9b6e26.tar.gz cinisis-0e67880b97909c08021ef5fa1075082cfc9b6e26.tar.bz2 |
Charset support on PhpIsisDb
Diffstat (limited to 'classes/PhpIsisDb.php')
-rw-r--r-- | classes/PhpIsisDb.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/classes/PhpIsisDb.php b/classes/PhpIsisDb.php index 169f832..b8f6566 100644 --- a/classes/PhpIsisDb.php +++ b/classes/PhpIsisDb.php @@ -50,6 +50,10 @@ class PhpIsisDb implements IsisDb { return FALSE; } + // Charset conversion. + array_walk_recursive($data, array('PhpIsisDb', 'charset')); + + // Return the result. return $this->tag(isis_fetch_array($results)); } @@ -90,6 +94,25 @@ class PhpIsisDb implements IsisDb { $data[$name] = $value; } } + return $data; - } + } + + /** + * Charset conversion. + * + * Converts a string from the database charset to UTF-8. + * + * @param $data + * String to be converted. + * + * @param $count + * Data index. Currently unused. + * + * @return + * String converted to UTF-8. + */ + function charset($data, $count) { + return iconv($data, $this->format['db']['charset'], 'UTF-8'); + } } |