Search code examples
escapingcharacterlamp

LAMP: retrieving international (i.e. chinese) characters from an URL


I am trying to retrieve a string of characters from an URL, i.e.:

http://www.domain.com/mystring

using

$_SERVER['REQUEST_URI']

This works pretty well with ASCII characters, but doesn't with international characters such as chinese, etc as the string gets escaped i.e.

テスト

becomes

/%E3%83%86%E3%82%B9%E3%83%88

Any help on how to address that would be much appreciated.


Solution

  • I found this solution :

    urldecode($_SERVER['REQUEST_URI'])