[TYPO3-core] RFX: #9286: use native JSON-methods instead of 3rd party json script

Benjamin Mack benni at typo3.org
Thu Sep 11 19:47:55 CEST 2008


Hey Steffen,

Steffen Kamper wrote:
> Hi Stan,
> 
> the 3rd party script also only allow utf-8:
> "All strings should be in ASCII or UTF-8 format! "
> 
> So it's the same. But good that you point to this, function could 
> convert to utf-8 before encoding. This should work for BE and FE.
> 
> vg Steffen
Hey,

yes, I noticed now as well, did anyone cover that? This info should go 
in the t3lib_div function as well.

Also, here are some other infos from our older discussions:

============= Olly Hader on 5th Sep 07 =============

Martin Kutschker schrieb:
 > > In t3lib_div.php there is now a array2json() that makes use of a
 > > JSON-class. How does this class compare to PHP 5.2's json_encode?
 > >
 > > Maybe we can add some helper code for PHP 5.0 and 5.1 that load this
 > > class only when json_encode is not present. We did something like that
 > > for clone().

Yes, this was discussed in "RFC: Moving t3lib_TCEforms_inline::getJSON()
to t3lib_div::array2json()" on this list. Since there might be some
Linux distributors that ship with PHP 5.0/5.1 we decided to use the
"Services_JSON" class.
=============


============= Dmitry on 5th Sep 07 =============

 > Maybe we can add some helper code for PHP 5.0 and 5.1 that load this 
class only when json_encode is not present. We did something like that 
for clone().

I read comparison on the net once. PHP's own json_encode has very strict 
rules and it is the most strict among other frameworks. Even browsers 
are not so strict. It supports only utf-8. I remember the other 
framework was recommended instead of PHP's own. The only thing where 
PHP's json won was time spent for encoding.

Check this, for example:
http://gggeek.altervista.org/sw/article_20061113.html

=============



-- 
All the best,
benni.
-SDG-


More information about the TYPO3-team-core mailing list