See how the values you specified are at the byte level.
I copied æøåfrom your question and �from your title. The reason for this �is that I had to use the Windows console application to get the title of your question, and its code page is Windows 1252 (copying from the browser gave me Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD)).
In a script encoded in UTF-8, this gives:
<?php
$s = 'æøå';
$s2 = '�';
echo "s iso-8859-1 ", @reset(unpack("H*", mb_convert_encoding($s, "ISO-8859-1", "UTF-8"))), "\n";
echo "s2 win-1252 ", @reset(unpack("H*", mb_convert_encoding($s, "WINDOWS-1252", "UTF-8"))), "\n";
s iso-8859-1 e6f8e5
s2 win-1252 e6f8e5
So, the byte representation is the same. The problem here is that when you write æøåeither:
- You write it in ISO-8859-1 instead of UTF-8. Check out your text editor.
- The value is converted from UTF-8 to ISO-8859-1 (unlikely)
source
share