Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

unicode: Fixed #4340 -- added a few character set encodings that Post…

…greSQL 7.x

can return. Pointed out by tim@tryphon.org.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5286 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f1091ec619195a610f8b2df49cf647110ca0890e 1 parent 695a21a
Malcolm Tredinnick authored May 19, 2007
46  django/db/backends/postgresql/encodings.py
@@ -2,6 +2,7 @@
2 2
 # doesn't exist in psycopg, so we have to maintain it by hand (using
3 3
 # information from section 21.2.1 in the PostgreSQL manual).
4 4
 ENCODING_MAP = {
  5
+    "ALT": 'cp866',
5 6
     "BIG5": 'big5-tw',
6 7
     "EUC_CN": 'gb2312',
7 8
     "EUC_JP": 'euc_jp',
@@ -26,8 +27,11 @@
26 27
     "LATIN9": 'iso8859_15',
27 28
     "SJIS": 'shift_jis',
28 29
     "SQL_ASCII": 'ascii',
  30
+    "TCVN": 'cp1258',
29 31
     "UHC": 'cp949',
  32
+    "UNICODE": 'utf-8',
30 33
     "UTF8": 'utf-8',
  34
+    "WIN": 'cp1251',
31 35
     "WIN866": 'cp866',
32 36
     "WIN874": 'cp874',
33 37
     "WIN1250": 'cp1250',
@@ -39,46 +43,6 @@
39 43
     # Unsupported (no equivalents in codecs module):
40 44
     # EUC_TW
41 45
     # LATIN10
  46
+    # MULE_INTERNAL
42 47
 }
43  
-# Mapping between PostgreSQL encodings and Python codec names. This mapping
44  
-# doesn't exist in psycopg, so we have to maintain it by hand (using
45  
-# information from section 21.2.1 in the PostgreSQL manual).
46  
-ENCODING_MAP = {
47  
-    "BIG5": 'big5-tw',
48  
-    "EUC_CN": 'gb2312',
49  
-    "EUC_JP": 'euc_jp',
50  
-    "EUC_KR": 'euc_kr',
51  
-    "GB18030": 'gb18030',
52  
-    "GBK": 'gbk',
53  
-    "ISO_8859_5": 'iso8859_5',
54  
-    "ISO_8859_6": 'iso8859_6',
55  
-    "ISO_8859_7": 'iso8859_7',
56  
-    "ISO_8859_8": 'iso8859_8',
57  
-    "JOHAB": 'johab',
58  
-    "KOI8": 'koi18_r',
59  
-    "KOI18R": 'koi18_r',
60  
-    "LATIN1": 'latin_1',
61  
-    "LATIN2": 'iso8859_2',
62  
-    "LATIN3": 'iso8859_3',
63  
-    "LATIN4": 'iso8859_4',
64  
-    "LATIN5": 'iso8859_9',
65  
-    "LATIN6": 'iso8859_10',
66  
-    "LATIN7": 'iso8859_13',
67  
-    "LATIN8": 'iso8859_14',
68  
-    "LATIN9": 'iso8859_15',
69  
-    "SJIS": 'shift_jis',
70  
-    "SQL_ASCII": 'ascii',
71  
-    "UHC": 'cp949',
72  
-    "UTF8": 'utf-8',
73  
-    "WIN866": 'cp866',
74  
-    "WIN874": 'cp874',
75  
-    "WIN1250": 'cp1250',
76  
-    "WIN1251": 'cp1251',
77  
-    "WIN1252": 'cp1252',
78  
-    "WIN1256": 'cp1256',
79  
-    "WIN1258": 'cp1258',
80 48
 
81  
-    # Unsupported (no equivalents in codecs module):
82  
-    # EUC_TW
83  
-    # LATIN10
84  
-}

0 notes on commit f1091ec

Please sign in to comment.
Something went wrong with that request. Please try again.