zotonic/zotonic — pull request #288 by fcardinaux (2012-01-31 00:22:58+00:00)
Title: Modified the to_json filter to allow UTF8-encoded character strings

With these changes, it is possible to specify that the input term contains UTF8-encoded character strings.

Here is an example with the French word "zèbre", which means zebra:

{{ ["zèbre"]|to_json:"utf8" }}

will be encoded in ["z\u00e8bre"], which will be displayed correctly: zèbre.

It is still possible to use to_json without parameter. However, it will break the unicode encoding:

{{ ["zèbre"]|to_json }}

will be encoded in ["z\u00c3\u00a8bre"], which will be incorrectly displayed: zÃ¨bre