This system has a "C.utf8" locale which appears disfunctional, all
other utf8 locales are OK. So change the locale probe to avoid this
one if possible.
The HP-UX shell also seems to have some trouble with UTF-8 (especially
if the user set this C.utf8 locale where it just barfs on everything),
so rework the test to not involve the shell trying to decode strings.