On Sat, Sep 10, 2011 at 8:28 PM, Niklas Laxström
<niklas.laxstrom(a)gmail.com> wrote:
Another point came up in IRC discussions: "JSON
converts UTF-8
characters to unicode escape sequences. serialize() does not."
This effectively negates any size advantages JSON might have. I
noticed JSON is used extensively in resource loader.
Roan: did you consider this point when choosing JSON format for
storing message resources?
No, I didn't know this and didn't think about it. The reason I chose
JSON is because the primary use case of the message blobs was to be
sent to JavaScript and used for i18n there, so it was convenient to
keep it as JSON the whole time and not have to do any decoding or
encoding for the primary use case. The only case in which PHP needs to
read the JSON data is when a single message is changed in the
MediaWiki: namespace, in which case the blob is decoded, the message
contents are swapped out, and the blob is re-encoded.
Roan Kattouw (Catrope)