--- orig/mysql-connector-java-5.1.8/src/com/mysql/jdbc/CharsetMapping.java 2009-07-15 03:12:13.000000000 +1000 +++ mysql-connector-java-5.1.8/src/com/mysql/jdbc/CharsetMapping.java 2009-08-14 15:11:44.000000000 +1000 @@ -927,6 +927,10 @@ * @throws SQLException if determination of the character encoding fails */ final static String getCharacterEncodingForErrorMessages(ConnectionImpl conn) throws SQLException { + if (conn.getEncoding() != null) { + return conn.getEncoding(); + } + String errorMessageFile = conn.getServerVariable("language"); if (errorMessageFile == null || errorMessageFile.length() == 0) {