Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2001-05-09 21:11:26 +0000
committerBruce Momjian2001-05-09 21:11:26 +0000
commit999a4d48d3727774d1c36b734130cdc0931a2bc9 (patch)
tree95adb4898bcde05f0e528d6ed3d0bdd95f5c669f
parent8678929c22111863e9d6b836232dc4f69c52d9ae (diff)
that's just me again, here's normal patch for KOI8_U to
jdbc/Connection.java Andy P.S. in Connection.java if encoding=="WIN" then dbEncoding is set to "Cp1252". What if it's Cyrillic "WIN"? Than it should be "Cp1251". Is there any way to fix that without making different "WIN" encodings in PostgreSQL? Andy Rysin
-rw-r--r--src/interfaces/jdbc/org/postgresql/Connection.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/Connection.java b/src/interfaces/jdbc/org/postgresql/Connection.java
index 87fbc337a73..d5d27762a60 100644
--- a/src/interfaces/jdbc/org/postgresql/Connection.java
+++ b/src/interfaces/jdbc/org/postgresql/Connection.java
@@ -10,7 +10,7 @@ import org.postgresql.largeobject.*;
import org.postgresql.util.*;
/**
- * $Id: Connection.java,v 1.14 2001/01/31 08:26:01 peter Exp $
+ * $Id: Connection.java,v 1.15 2001/05/09 21:11:26 momjian Exp $
*
* This abstract class is used by org.postgresql.Driver to open either the JDBC1 or
* JDBC2 versions of the Connection class.
@@ -307,7 +307,16 @@ public abstract class Connection
} else if (dbEncoding.equals("EUC_TW")) {
dbEncoding = "EUC_TW";
} else if (dbEncoding.equals("KOI8")) {
- dbEncoding = "KOI8_R";
+ // try first if KOI8_U is present, it's a superset of KOI8_R
+ try {
+ dbEncoding = "KOI8_U";
+ "test".getBytes(dbEncoding);
+ }
+ catch(UnsupportedEncodingException uee) {
+ // well, KOI8_U is still not in standard JDK, falling back to KOI8_R :(
+ dbEncoding = "KOI8_R";
+ }
+
} else if (dbEncoding.equals("WIN")) {
dbEncoding = "Cp1252";
} else {