David Foerster's answer was very instructive. Thanks for answer. Don't have rep to comment apparently (think I forgot my original account). But wanted to add the locale chosen must exist (and the given string must be valid within that locale.
E.g. I do not have en_US.UTF-8, so my output was
content-type:text/html; charset:utf-8
?EURo Dikaiopolis en agro estin
?EURo Dikaiopolis en agro estin
4 5 6
When I changed it to a proper locale for the system, I got the expected:
content-type:text/html; charset:utf-8
🕽€ο Δικαιοπολις εν αγρω εστιν
🕽€ο Δικαιοπολις εν αγρω εστιν
4
5
6