json_encode UTF-8 in PHP 5.3.3
<p>Trying to save data with specials characters using json_encode.</p>

<p>Code sample:</p>

<pre><code>$a = array("Name" =&gt; "SáENZ PEñA");
echo "Normal : ",  json_encode($a), "&lt;br&gt;";
echo "Unicode : ", json_encode($a, JSON_UNESCAPED_UNICODE), "&lt;br&gt;";
</code></pre>

<p><strong>JSON_UNESCAPED_UNICODE</strong> solve the issue with php 5.6 </p>

<pre><code>Normal : {"Name":"S\u00e1ENZ PE\u00f1A"}
Unicode : {"Name":"SáENZ PEñA"}
</code></pre>

<p>but unfortunelly i have php 5.3 :</p>

<pre><code>Normal : {"Name":"S\u00e1ENZ PE\u00f1A"}
Unicode : 
Warning: json_encode() expects parameter 2 to be long, string given in /var/www/.../TEST.php on line 4
</code></pre>

<p>Any solution that works with php 5.3 ?</p>