From b64dd897ffeeb50e0b89b6f4c8eeac71258e2228 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 14 Nov 2004 17:36:37 +0000 Subject: [PATCH] using own squirrelmail functions for encoding/decoding instead of xml functions. fixes bug.655137 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8373 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/abook_ldap_server.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/functions/abook_ldap_server.php b/functions/abook_ldap_server.php index fe0fff45..c8848bc1 100644 --- a/functions/abook_ldap_server.php +++ b/functions/abook_ldap_server.php @@ -207,19 +207,16 @@ class abook_ldap_server extends addressbook_backend { * @return string encoded string */ function charset_encode($str) { - if($this->charset == 'utf-8') { - if(function_exists('utf8_encode')) { - return utf8_encode($str); - } else { - return $str; - } + global $default_charset; + if($this->charset != $default_charset) { + return charset_convert($default_charset,$str,$this->charset,false); } else { return $str; } } /** - * Decode from charset used by this LDAP server to html entities + * Decode from charset used by this LDAP server to charset used by translation * * Uses squirrelmail charset_decode functions * @param string string that has to be decoded @@ -228,7 +225,7 @@ class abook_ldap_server extends addressbook_backend { function charset_decode($str) { global $default_charset; if ($this->charset != $default_charset) { - return charset_decode($this->charset,$str); + return charset_convert($this->charset,$str,$default_charset,false); } else { return $str; } -- 2.25.1