Search code examples
phpencodingutf-8iso-8859-1utf8-decode

how to convert quote from utf8 to iso in php?


I want to convert some text from utf-8 to iso-8859-1 (in PHP) so I do this:

$message_iso = utf8_decode($message_utf8);

It works pretty well for é or ô but not for the simple quote ' which is replace by a ? . How can I make it work? Thanks


Solution

  • Maybe use iconv for this:

    $message_iso = iconv("UTF-8", "ISO-8859-1", $message_utf8);