More robust check for UTF-8 charset
Submitted by Mikhail Zabaluev
g_get_charset() uses a case-sensitive substring match for "UTF-8" in order to decide if the character set specified by the environment is UTF-8. The matching should either be made strict, or then allow case-insensitivity and actually use the aliases rather than shambolic heuristics.
This dates back from commit b5fa5b98 made in 2001 while working on bug #58195.