Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf737b8

Browse files
author
Barry Lind
committed
Updated the list of encodings supported to match what the backend now supports
1 parent f50793c commit bf737b8

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/interfaces/jdbc/org/postgresql/core/Encoding.java

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Converts to and from the character encoding used by the backend.
1010
*
11-
* $Id: Encoding.java,v 1.1 2001/07/21 18:52:11 momjian Exp $
11+
* $Id: Encoding.java,v 1.2 2001/10/16 20:07:17 barry Exp $
1212
*/
1313

1414
public class Encoding {
@@ -21,27 +21,40 @@ public class Encoding {
2121
private static final Hashtable encodings = new Hashtable();
2222

2323
static {
24+
//Note: this list should match the set of supported server
25+
// encodings found in backend/util/mb/encnames.c
2426
encodings.put("SQL_ASCII", new String[] { "ASCII", "us-ascii" });
2527
encodings.put("UNICODE", new String[] { "UTF-8", "UTF8" });
2628
encodings.put("LATIN1", new String[] { "ISO8859_1" });
2729
encodings.put("LATIN2", new String[] { "ISO8859_2" });
2830
encodings.put("LATIN3", new String[] { "ISO8859_3" });
2931
encodings.put("LATIN4", new String[] { "ISO8859_4" });
30-
encodings.put("LATIN5", new String[] { "ISO8859_5" });
31-
encodings.put("LATIN6", new String[] { "ISO8859_6" });
32-
encodings.put("LATIN7", new String[] { "ISO8859_7" });
33-
encodings.put("LATIN8", new String[] { "ISO8859_8" });
34-
encodings.put("LATIN9", new String[] { "ISO8859_9" });
32+
encodings.put("ISO_8859_5", new String[] { "ISO8859_5" });
33+
encodings.put("ISO_8859_6", new String[] { "ISO8859_6" });
34+
encodings.put("ISO_8859_7", new String[] { "ISO8859_7" });
35+
encodings.put("ISO_8859_8", new String[] { "ISO8859_8" });
36+
encodings.put("LATIN5", new String[] { "ISO8859_9" });
37+
encodings.put("LATIN7", new String[] { "ISO8859_13" });
38+
encodings.put("LATIN9", new String[] { "ISO8859_15_FDIS" });
3539
encodings.put("EUC_JP", new String[] { "EUC_JP" });
3640
encodings.put("EUC_CN", new String[] { "EUC_CN" });
3741
encodings.put("EUC_KR", new String[] { "EUC_KR" });
3842
encodings.put("EUC_TW", new String[] { "EUC_TW" });
39-
encodings.put("WIN", new String[] { "Cp1252" });
43+
encodings.put("SJIS", new String[] { "SJIS" });
44+
encodings.put("BIG5", new String[] { "Big5" });
45+
encodings.put("WIN1250", new String[] { "Cp1250" });
46+
encodings.put("WIN", new String[] { "Cp1251" });
47+
encodings.put("ALT", new String[] { "Cp866" });
4048
// We prefer KOI8-U, since it is a superset of KOI8-R.
4149
encodings.put("KOI8", new String[] { "KOI8_U", "KOI8_R" });
4250
// If the database isn't encoding-aware then we can't have
4351
// any preferred encodings.
4452
encodings.put("UNKNOWN", new String[0]);
53+
// The following encodings do not have a java equivalent
54+
encodings.put("MULE_INTERNAL", new String[0]);
55+
encodings.put("LATIN6", new String[0]);
56+
encodings.put("LATIN8", new String[0]);
57+
encodings.put("LATIN10", new String[0]);
4558
}
4659

4760
private final String encoding;

0 commit comments

Comments
 (0)