Special Characters from a POST

Is there a way to get accented characters like é from a POST value? I tried specialcharacters(), urlencode, and nothing worked.

Try using this function (found on PHP.net):


function fix_string($str) {
        return strtr($str,
            chr(130).chr(136).chr(138).chr(137).
            chr(133).chr(131).chr(132).chr(140).
            chr(139).chr(151).chr(150).chr(129).
            chr(147).chr(148).chr(135),
            chr(233).chr(234).chr(232).chr(235).
            chr(224).chr(226).chr(228).chr(238).
            chr(239).chr(249).chr(251).chr(252).
            chr(244).chr(246).chr(231)
        );
    }

No matter which way you go, you will probably end up using the string translate function: http://us2.php.net/strtr

Thanks, but how do I decode characters created by escape() in JS(i.e. %u0108olada) from the database?

PHP function: rawurldecode($string);

It’s cool. Stupid encoding headers.

I just used this line of code to fix that problem in a portuguese content form:
$content.= "Content-Type: text/html; charset=“iso-8859-1"
”;

hope it helps

RF