ZF-4054: UTF8 character encoding for Zend_Json_Encoder


Zend_Json_Encoder does not support encoding of UTF8 characters.




instead of the following which is generated with json_encode() which does support UTF8 characters



FYI: I am using this library for JSON encoding and it works great for UTF-8 characters.


It is licensed under BSD.

Would it be possible to contact the authors to see if they can contribute the code to ZF or do you have other plans on how to incorporate UTF-8 encoding?

This is becoming an increasingly important issue for the FirePHP integration as well as international ZF userbase that uses AJAX.

The JSON Spec does not require unicode characters to be in ASCII Sequences

The question then is; do we try and produce the same output as json_encode()?

i guess we should, and matthew had the same opinion on that.

I'll look into it.

The incubator now holds a version of Zend_Json that has unicode transformation for both encoding and decoding making it consistant with json_encode()/json_decode()

Please test this with your use-cases (make sure to set the internal encoder decoder = true).

Works like a charm. All my tests are still passing.

quick fix

$ svn co http://framework.zend.com/svn/framework/…

worked for me

Moved from incubator to trunk in r14399, scheduled for 1.8 release