Correctly handle other MySQL character sets (see #7140)