From: Ralf B. <rb...@st...> - 2010-09-29 21:23:56
|
That's the reason, why we only support utf-8 in Trunk. So do yourself a favor and convert your installation to utf-8. 1.8 still works with other charsets, but it is NOT recommened, nor can your create new installs with charsets other then utf-8. Ralf Am 29.09.10 22:10, schrieb GeorgK: > > Hello, > > since the new json-module I had the problem, that felamimail doesn't refresh > correct. > After intensive debugging I've found the problem. On the server isn't UTF-8 > default charset. So it breaks the json_encode-function on the first > non-UTF-8-character. > > Here is my patch/workaround: > > Index: class.egw_json.inc.php > =================================================================== > --- class.egw_json.inc.php (Revision 32205) > +++ class.egw_json.inc.php (Arbeitskopie) > @@ -397,6 +397,29 @@ > } > } > > + public function utf8json($inArray) { > + static $depth = 0; > + /* our return object */ > + $newArray = array(); > + /* safety recursion limit */ > + $depth ++; > + if($depth>= '30') { > + return false; > + } > + /* step through inArray */ > + foreach($inArray as $key=>$val) { > + if(is_array($val)) { > + /* recurse on array elements */ > + $newArray[$key] = self::utf8json($val); > + } else { > + /* encode string values */ > + $newArray[$key] = utf8_encode($val); > + } > + } > + /* return utf8 encoded array */ > + return $newArray; > + } > + > /** > * Returns the actual JSON code generated by calling the above "add" > function. > * > @@ -409,7 +432,7 @@ > /* Wrap the result array into a parent "response" Object */ > $res = array('response' => $inst->responseArray); > > - return json_encode($res); //PHP5.3+, JSON_HEX_TAG | JSON_HEX_APOS | > JSON_HEX_QUOT | > JSON_HEX_AMP); > + return json_encode(self::utf8json($res)); //PHP5.3+, JSON_HEX_TAG | > JSON_HEX_APOS | > JSON_HEX_QUOT | JSON_HEX_AMP); > } > > /** > > > Georg Klimm > > LOHN24.de GmbH Internetlohnabrechnungen ila > Hausanschrift: Jahnstrasse 35 * 12347 Berlin > Postanschrift: Postfach 47 06 69 * 12315 Berlin > Tel: +49 30 66909200 * Fax: +49 30 6644208 > Internet: http://www.lohn24.de > AG Berlin-Charlottenburg HRB 92027 > Geschäftsführer Hans-Joachim May -- Ralf Becker Director Software Development Stylite GmbH [open style of IT] Morschheimer Strasse 15 67292 Kirchheimbolanden fon +49 (0) 6352 70629-0 fax +49 (0) 6352 70629-30 mailto: rb...@st... www.stylite.de www.egroupware.org ________________________________________________ Geschäftsführer Andre Keller, Gudrun Müller, Ralf Becker Registergericht Kaiserslautern HRB 30575 Umsatzsteuer-Id / VAT-Id: DE214280951 |