Decode a byte encoded string via my URL
<p>We have a PHP site on Zend Framework with a backend Postgresql database. Our primary character encoding is UTF-8.</p>

<p>I just checked our error log and found a strange entry. My URL is as follows:
www.mydomain.com/schuhe-für-breite-füsse</p>

<p>however someone (or maybe a bot) has tried to access this URL as follows:
www.mydomain.com/schuhe-f\xc3\xbcr-breite-f\xc3\xbcsse/</p>

<p>It's the first time I've seen something like the above. Two things are happening on my page:
1) The above URL is queried against our CMS. This works fine for some reason, I think Postgresql reaslises it is byte-encoded and then converts it back when tried to find this SEF URL in our database.</p>

<p>2) An Ajax request is made on the page, passing the same SEF URL. This fails. I believe the slashes are causing a problem on Javascript.</p>

<p>To avoid this I want to decode any URL that is encoded like this. However a quick test of the following code did not decode anything for me :(</p>

<pre><code>$landing_sef_url = $this-&gt;_getParam('landing_sef_url');
$utf8=html_entity_decode($landing_sef_url);
$iso8859=utf8_decode($utf8);
$test3 = html_entity_decode($landing_sef_url, 1, "ISO-8859-1");
$test4 = urldecode($landing_sef_url);

echo utf8_decode("$landing_sef_url");
echo "&lt;br/&gt;&lt;br/&gt;";
die($landing_sef_url . " -- $utf8 -- $iso8859 &lt;br/&gt;$test3&lt;br/&gt;$test4");
</code></pre>

<p>I found the above via various posts online but they all print back the same result - schuhe-f\xc3\xbcr-breite-f\xc3\xbcsse</p>

<p>Any help would be MUCH appreciated. Many thanks!</p>
