Message 75253 - Python tracker
Converting to the lower case doesn't solve the problem: if the locale is "utf8" and Python checks for "utf-8", the optimization will fail. Another example: iso-8859-1, latin-1 or latin1? A correct patch would be to get the most common name of the charset and make sure that Python C code always use this name.