Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit999a4d4

Browse files
committed
that's just me again, here's normal patch for KOI8_U to
jdbc/Connection.javaAndyP.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 anyway to fix that without making different "WIN" encodings inPostgreSQL?Andy Rysin
1 parent8678929 commit999a4d4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/interfaces/jdbc/org/postgresql/Connection.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
importorg.postgresql.util.*;
1111

1212
/**
13-
* $Id: Connection.java,v 1.14 2001/01/31 08:26:01 peter Exp $
13+
* $Id: Connection.java,v 1.15 2001/05/09 21:11:26 momjian Exp $
1414
*
1515
* This abstract class is used by org.postgresql.Driver to open either the JDBC1 or
1616
* JDBC2 versions of the Connection class.
@@ -307,7 +307,16 @@ protected void openConnection(String host, int port, Properties info, String dat
307307
}elseif (dbEncoding.equals("EUC_TW")) {
308308
dbEncoding ="EUC_TW";
309309
}elseif (dbEncoding.equals("KOI8")) {
310-
dbEncoding ="KOI8_R";
310+
// try first if KOI8_U is present, it's a superset of KOI8_R
311+
try {
312+
dbEncoding ="KOI8_U";
313+
"test".getBytes(dbEncoding);
314+
}
315+
catch(UnsupportedEncodingExceptionuee) {
316+
// well, KOI8_U is still not in standard JDK, falling back to KOI8_R :(
317+
dbEncoding ="KOI8_R";
318+
}
319+
311320
}elseif (dbEncoding.equals("WIN")) {
312321
dbEncoding ="Cp1252";
313322
}else {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp