0

I have a server that works with windows-1252 and I have a problem with characters à, À, í and Í. I need to replace this special characters to a, A, i and I in PHP.

As you can see in the following URL https://www.i18nqa.com/debug/utf8-debug.html this values have the same value: "Ã".

How can I make the replace if it have the same character?

  • [iconv](https://www.php.net/manual/en/function.iconv.php) with the `//TRANSLIT` appended to the target encoding should work – apokryfos Jun 27 '22 at 21:14
  • 1
    Look more carefully at the table - each of them has *two characters*, the *first of which* is "Ã". Also note that that table is not of UTF-8, but of a common result of previously mishandling UTF-8. – IMSoP Jun 27 '22 at 21:15
  • activate mbstring extension then ';$str=mb_ereg_replace('À', 'A', $str);$str=mb_ereg_replace('Ã', 'A', $str);$str=mb_ereg_replace('Í', 'I', $str);$str=mb_ereg_replace('à', 'a', $str);$str=mb_ereg_replace('í', 'i', $str);echo 'new str:'.$str; ?> –  Jun 27 '22 at 21:32
  • Does it answer your question? https://stackoverflow.com/questions/35234129/how-to-convert-windows-1252-characters-to-values-in-php – Monnomcjo Jun 28 '22 at 10:47

0 Answers0