in reply to Convert hex to UTF-8

The output should be a correctly encoded UTF-8

That's got nothing to do with how the string is stored internally.

You haven't shown where you encode the output, so I presumed you didn't. That's a bug. Don't you see the warnings? Once I add any of the following, it correctly outputs UTF-8.

use open ':std', ':utf8';
use open ':std', ':locale'; # If you use a UTF-8 locale
binmode STDOUT, ':utf8'; binmode STDERR, ':utf8';