Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@malcolmt malcolmt authored
Showing with 5 additions and 41 deletions.
  1. +5 −41 django/db/backends/postgresql/encodings.py
View
46 django/db/backends/postgresql/encodings.py
@@ -2,6 +2,7 @@
# doesn't exist in psycopg, so we have to maintain it by hand (using
# information from section 21.2.1 in the PostgreSQL manual).
ENCODING_MAP = {
+ "ALT": 'cp866',
"BIG5": 'big5-tw',
"EUC_CN": 'gb2312',
"EUC_JP": 'euc_jp',
@@ -26,8 +27,11 @@
"LATIN9": 'iso8859_15',
"SJIS": 'shift_jis',
"SQL_ASCII": 'ascii',
+ "TCVN": 'cp1258',
"UHC": 'cp949',
+ "UNICODE": 'utf-8',
"UTF8": 'utf-8',
+ "WIN": 'cp1251',
"WIN866": 'cp866',
"WIN874": 'cp874',
"WIN1250": 'cp1250',
@@ -39,46 +43,6 @@
# Unsupported (no equivalents in codecs module):
# EUC_TW
# LATIN10
+ # MULE_INTERNAL
}
-# Mapping between PostgreSQL encodings and Python codec names. This mapping
-# doesn't exist in psycopg, so we have to maintain it by hand (using
-# information from section 21.2.1 in the PostgreSQL manual).
-ENCODING_MAP = {
- "BIG5": 'big5-tw',
- "EUC_CN": 'gb2312',
- "EUC_JP": 'euc_jp',
- "EUC_KR": 'euc_kr',
- "GB18030": 'gb18030',
- "GBK": 'gbk',
- "ISO_8859_5": 'iso8859_5',
- "ISO_8859_6": 'iso8859_6',
- "ISO_8859_7": 'iso8859_7',
- "ISO_8859_8": 'iso8859_8',
- "JOHAB": 'johab',
- "KOI8": 'koi18_r',
- "KOI18R": 'koi18_r',
- "LATIN1": 'latin_1',
- "LATIN2": 'iso8859_2',
- "LATIN3": 'iso8859_3',
- "LATIN4": 'iso8859_4',
- "LATIN5": 'iso8859_9',
- "LATIN6": 'iso8859_10',
- "LATIN7": 'iso8859_13',
- "LATIN8": 'iso8859_14',
- "LATIN9": 'iso8859_15',
- "SJIS": 'shift_jis',
- "SQL_ASCII": 'ascii',
- "UHC": 'cp949',
- "UTF8": 'utf-8',
- "WIN866": 'cp866',
- "WIN874": 'cp874',
- "WIN1250": 'cp1250',
- "WIN1251": 'cp1251',
- "WIN1252": 'cp1252',
- "WIN1256": 'cp1256',
- "WIN1258": 'cp1258',
- # Unsupported (no equivalents in codecs module):
- # EUC_TW
- # LATIN10
-}

0 comments on commit f1091ec

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