*** ./org/postgresql/Connection.java.orig Fri May 25 16:23:02 2001 --- ./org/postgresql/Connection.java Fri May 25 16:26:55 2001 *************** *** 267,273 **** // firstWarning = null; ! java.sql.ResultSet initrset = ExecSQL("set datestyle to 'ISO'; select getdatabaseencoding()"); String dbEncoding = null; //retrieve DB properties --- 267,274 ---- // firstWarning = null; ! java.sql.ResultSet initrset = ExecSQL("set datestyle to 'ISO'; " + ! "select case when pg_encoding_to_char(1) = 'SQL_ASCII' then 'UNKNOWN' else getdatabaseencoding() end"); String dbEncoding = null; //retrieve DB properties *************** *** 319,324 **** --- 320,330 ---- } else if (dbEncoding.equals("WIN")) { dbEncoding = "Cp1252"; + } else if (dbEncoding.equals("UNKNOWN")) { + //This isn't a multibyte database so we don't have an encoding to use + //We leave dbEncoding null which will cause the default encoding for the + //JVM to be used + dbEncoding = null; } else { dbEncoding = null; }