tests: Adapt utf8locale to musl
utf8locale test failed in musl:
Testing unit: utf8locale
NULL input: passed
Empty string: passed
ASCII text: passed
non-ASCII text in UTF-8 locale: passed
OTP message in UTF-8 locale: passed
non-ASCII text in ISO-8859-2 locale: failed
reason: output differs: expected=`��len� �lu�ou�k�' is=`Šíleně žluťoučký'
non-ASCII text in C locale: failed
reason: correct is NULL, output is not NULL and should be
Test results: unit = utf8locale, passed = 5, failed = 2, skipped = 0
The cause of "ISO-8859-2 locale" failure was that musl does not yet
fully support locales and handles any character set identifier in
a locale specifier as an alias for UTF-8. This patch fixes the test by
validing a code set the exampled locale actually sets.
"non-ASCII text in C locale" failed because musl performs a lossy
conversion (replaces unrepresantable chacracters with stars) in constrat
to strict conversion done by glibc. POSIX recommends "an
implementation-defined conversion" in that case. Because
_isds_utf82locale is only used for presenting messages, a lossy output
is not a big deal (libisds simply omitts an incovertible part of
a message on glibc). This patch relaxes the test to accept any output.
We keep the test here to cover all code paths.
https://www.openwall.com/lists/musl/2024/05/11/6
https://bugs.gentoo.org/show_bug.cgi?id=928107