Some string that I get is encoded by UTF-8 and contains some special characters like Å, Ä ', Ä, etc. I use StringReplace() to convert it to plain text, but I can only convert one type of character. Since PHP also has a function for replacing strings, as shown here: how to replace special characters with those on which they are based on PHP? but supports arrays:
<?php $vOriginalString = "¿Dónde está el niño que vive aquí? En el témpano o en el iglú. ÁFRICA, MÉXICO, ÍNDICE, CANCIÓN y NÚMERO."; $vSomeSpecialChars = array("á", "é", "í", "ó", "ú", "Á", "É", "Í", "Ó", "Ú", "ñ", "Ñ"); $vReplacementChars = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U", "n", "N"); $vReplacedString = str_replace($vSomeSpecialChars, $vReplacementChars, $vOriginalString); echo $vReplacedString;
How can I do this in Delphi? StringReplace does not support arrays.