You cannot send the “í” character to a URL; URLs must use a subset of ASCII encoding. Therefore, the URL is encoded to ?dialog=sab%C3%ADa your browser before being sent to the server. %C3%AD represents two bytes of C3 AD , which is the UTF-8 encoding for the character "í". You can confirm this with var_dump($_SERVER['QUERY_STRING']); . This automatically decrypted PHP, the result is a sequence of UTF-8 byte for "sabía", where "í" is encoded using two bytes C3 AD .
Your browser interprets this sequence of bytes using the encoding Windows-1252 or ISO-8859-1. Byte C3 represents "Ã" in this encoding, byte AD is a soft hyphen and is invisible.
Two possible solutions:
In short, you need to make sure that you use the same encoding everywhere and tell the browser what exactly this encoding is.
source share