Encodings mapping reordered in a more maintainable order.

This commit is contained in:
Daniele Varrazzo 2010-12-14 03:10:23 +00:00
parent b96dcef8a2
commit 657bcb4828

View File

@ -325,7 +325,28 @@ psyco_adapters_init(PyObject *mod)
Fill the module's postgresql<->python encoding table */ Fill the module's postgresql<->python encoding table */
static encodingPair encodings[] = { static encodingPair encodings[] = {
{"SQL_ASCII", "ascii"}, {"ABC", "cp1258"},
{"ALT", "cp866"},
{"BIG5", "big5"},
{"EUC_JP", "euc_jp"},
{"EUC_KR", "euc_kr"},
{"GB18030", "gb18030"},
{"GBK", "gbk"},
{"ISO88591", "iso8859_1"},
{"ISO885913", "iso8859_13"},
{"ISO885914", "iso8859_14"},
{"ISO885915", "iso8859_15"},
{"ISO88592", "iso8859_2"},
{"ISO88593", "iso8859_3"},
{"ISO88595", "iso8859_5"},
{"ISO88596", "iso8859_6"},
{"ISO88597", "iso8859_7"},
{"ISO88598", "iso8859_8"},
{"ISO88599", "iso8859_9"},
{"JOHAB", "johab"},
{"KOI8", "koi8_r"},
{"KOI8R", "koi8_r"},
{"KOI8U", "koi8_u"},
{"LATIN1", "iso8859_1"}, {"LATIN1", "iso8859_1"},
{"LATIN2", "iso8859_2"}, {"LATIN2", "iso8859_2"},
{"LATIN3", "iso8859_3"}, {"LATIN3", "iso8859_3"},
@ -335,46 +356,25 @@ static encodingPair encodings[] = {
{"LATIN7", "iso8859_13"}, {"LATIN7", "iso8859_13"},
{"LATIN8", "iso8859_14"}, {"LATIN8", "iso8859_14"},
{"LATIN9", "iso8859_15"}, {"LATIN9", "iso8859_15"},
{"ISO88591", "iso8859_1"},
{"ISO88592", "iso8859_2"},
{"ISO88593", "iso8859_3"},
{"ISO88595", "iso8859_5"},
{"ISO88596", "iso8859_6"},
{"ISO88597", "iso8859_7"},
{"ISO885913", "iso8859_13"},
{"ISO88598", "iso8859_8"},
{"ISO88599", "iso8859_9"},
{"ISO885914", "iso8859_14"},
{"ISO885915", "iso8859_15"},
{"UNICODE", "utf_8"}, /* Not valid in 8.2, backward compatibility */
{"UTF8", "utf_8"},
{"WIN950", "cp950"},
{"Windows950", "cp950"},
{"BIG5", "big5"},
{"EUC_JP", "euc_jp"},
{"EUC_KR", "euc_kr"},
{"GB18030", "gb18030"},
{"GBK", "gbk"},
{"WIN936", "gbk"},
{"Windows936", "gbk"},
{"JOHAB", "johab"},
{"KOI8", "koi8_r"}, /* in PG: KOI8 == KOI8R == KOI8-R == KOI8-U
but in Python there is koi8_r AND koi8_u */
{"KOI8R", "koi8_r"},
{"SJIS", "cp932"},
{"Mskanji", "cp932"}, {"Mskanji", "cp932"},
{"ShiftJIS", "cp932"}, {"ShiftJIS", "cp932"},
{"WIN932", "cp932"}, {"SJIS", "cp932"},
{"Windows932", "cp932"}, {"SQL_ASCII", "ascii"},
{"TCVN", "cp1258"},
{"TCVN5712", "cp1258"},
{"UHC", "cp949"}, {"UHC", "cp949"},
{"WIN949", "cp949"}, {"UNICODE", "utf_8"}, /* Not valid in 8.2, backward compatibility */
{"Windows949", "cp949"}, {"UTF8", "utf_8"},
{"VSCII", "cp1258"},
{"WIN", "cp1251"},
{"WIN866", "cp866"}, {"WIN866", "cp866"},
{"ALT", "cp866"},
{"WIN874", "cp874"}, {"WIN874", "cp874"},
{"WIN932", "cp932"},
{"WIN936", "gbk"},
{"WIN949", "cp949"},
{"WIN950", "cp950"},
{"WIN1250", "cp1250"}, {"WIN1250", "cp1250"},
{"WIN1251", "cp1251"}, {"WIN1251", "cp1251"},
{"WIN", "cp1251"},
{"WIN1252", "cp1252"}, {"WIN1252", "cp1252"},
{"WIN1253", "cp1253"}, {"WIN1253", "cp1253"},
{"WIN1254", "cp1254"}, {"WIN1254", "cp1254"},
@ -382,10 +382,10 @@ static encodingPair encodings[] = {
{"WIN1256", "cp1256"}, {"WIN1256", "cp1256"},
{"WIN1257", "cp1257"}, {"WIN1257", "cp1257"},
{"WIN1258", "cp1258"}, {"WIN1258", "cp1258"},
{"ABC", "cp1258"}, {"Windows932", "cp932"},
{"TCVN", "cp1258"}, {"Windows936", "gbk"},
{"TCVN5712", "cp1258"}, {"Windows949", "cp949"},
{"VSCII", "cp1258"}, {"Windows950", "cp950"},
/* those are missing from Python: */ /* those are missing from Python: */
/* {"EUC_CN", "?"}, */ /* {"EUC_CN", "?"}, */