Unicode wildcards in PHP htmlspecialchars function

In the htmlspecialchars function, if you set the ENT_SUBSTITUTE flag, it is supposed to replace some invalid characters.

What characters are replaced? And what is the comparison between invalid characters and those that are used to replace it?

0
source share
1 answer

There is only one universal replacement character: U + FFFD. If you write UTF-8, then this code will be encoded accordingly. If not, you will receive a link to the symbol �.

No reversible mapping. By definition, the original sequence of bytes was invalid, that is, it does not matter (valid = matters).

( "" ), , - , . , UTF-16, , "" ( ). , ASCII, 127 .

+1

All Articles