No text output?

I wrote the following code, but for some reason the characters do not appear. Why?
If I eliminate 'UTF-8', it comes out fine, so it looks like there's a problem here, but what's wrong with it?
I thought the encoder should have been unified with UTF-8 as well.

<?php echo htmlspecialchars($error, ENT_QUOTES, 'UTF-8'); ?>

Apparently, the encoding of the text editor was not set to UTF-8.
Is that how you get nothing to show up?