Index: doc/src/sgml/charset.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/charset.sgml,v retrieving revision 2.67 diff -c -c -r2.67 charset.sgml *** doc/src/sgml/charset.sgml 14 Mar 2005 03:59:22 -0000 2.67 --- doc/src/sgml/charset.sgml 14 Mar 2005 18:10:19 -0000 *************** *** 537,542 **** --- 537,549 ---- WIN1251 Windows CP1251 + Western European + 1 + + + + WIN1252 + Windows CP1252 Cyrillic 1 WIN *************** *** 676,682 **** BIG5 ! not available as a server encoding --- 683,689 ---- BIG5 ! not supported as a server encoding *************** *** 711,722 **** GB18030 ! not available as a server encoding GBK ! not available as a server encoding --- 718,729 ---- GB18030 ! not supported as a server encoding GBK ! not supported as a server encoding *************** *** 847,853 **** SJIS ! not available as a server encoding --- 854,860 ---- SJIS ! not supported as a server encoding *************** *** 859,865 **** UHC ! not available as a server encoding --- 866,872 ---- UHC ! not supported as a server encoding *************** *** 902,907 **** --- 909,920 ---- + WIN1252 + WIN1252, + UTF8 + + + WIN1256 WIN1256, UTF8 Index: doc/src/sgml/func.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.240 diff -c -c -r1.240 func.sgml *** doc/src/sgml/func.sgml 7 Mar 2005 04:30:49 -0000 1.240 --- doc/src/sgml/func.sgml 14 Mar 2005 18:10:25 -0000 *************** *** 1991,1996 **** --- 1991,2002 ---- + utf8_to_windows_1252 + UTF8 + WIN1252 + + + utf8_to_windows_1256 UTF8 WIN1256 *************** *** 2057,2062 **** --- 2063,2074 ---- + windows_1252_to_utf8 + WIN1252 + UTF8 + + + windows_1256_to_utf8 WIN1256 UTF8 Index: src/backend/utils/mb/encnames.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/mb/encnames.c,v retrieving revision 1.24 diff -c -c -r1.24 encnames.c *** src/backend/utils/mb/encnames.c 13 Mar 2005 01:26:30 -0000 1.24 --- src/backend/utils/mb/encnames.c 14 Mar 2005 18:10:27 -0000 *************** *** 194,199 **** --- 194,202 ---- "win1251", PG_WIN1251 }, /* alias for Windows-1251 */ { + "win1252", PG_WIN1252 + }, /* alias for Windows-1252 */ + { "win1256", PG_WIN1256 }, /* alias for Windows-1256 */ { *************** *** 224,229 **** --- 227,235 ---- "windows1251", PG_WIN1251 }, /* Windows-1251; Microsoft */ { + "windows1252", PG_WIN1252 + }, /* Windows-1252; Microsoft */ + { "windows1256", PG_WIN1256 }, /* Windows-1256; Microsoft */ { *************** *** 335,340 **** --- 341,349 ---- "WIN1251", PG_WIN1251 }, { + "WIN1252", PG_WIN1252 + }, + { "ISO_8859_5", PG_ISO_8859_5 }, { Index: src/backend/utils/mb/wchar.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/mb/wchar.c,v retrieving revision 1.42 diff -c -c -r1.42 wchar.c *** src/backend/utils/mb/wchar.c 14 Mar 2005 00:19:13 -0000 1.42 --- src/backend/utils/mb/wchar.c 14 Mar 2005 18:10:27 -0000 *************** *** 738,743 **** --- 738,744 ---- {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 20; PG_WIN874 */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 21; PG_KOI8 */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 22; PG_WIN1251 */ + {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 22; PG_WIN1252 */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 23; PG_WIN866 */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 24; ISO-8859-5 */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 25; ISO-8859-6 */ Index: src/backend/utils/mb/conversion_procs/Makefile =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/Makefile,v retrieving revision 1.12 diff -c -c -r1.12 Makefile *** src/backend/utils/mb/conversion_procs/Makefile 7 Mar 2005 04:30:52 -0000 1.12 --- src/backend/utils/mb/conversion_procs/Makefile 14 Mar 2005 18:10:31 -0000 *************** *** 24,30 **** utf8_and_euc_jp utf8_and_euc_kr utf8_and_euc_tw utf8_and_gb18030 \ utf8_and_gbk utf8_and_iso8859 utf8_and_iso8859_1 utf8_and_johab \ utf8_and_sjis utf8_and_win1258 utf8_and_uhc utf8_and_win1250 \ ! utf8_and_win1256 utf8_and_win874 # conversion_name source_encoding destination_encoding function object CONVERSIONS = \ --- 24,30 ---- utf8_and_euc_jp utf8_and_euc_kr utf8_and_euc_tw utf8_and_gb18030 \ utf8_and_gbk utf8_and_iso8859 utf8_and_iso8859_1 utf8_and_johab \ utf8_and_sjis utf8_and_win1258 utf8_and_uhc utf8_and_win1250 \ ! utf8_and_win1252 utf8_and_win1256 utf8_and_win874 # conversion_name source_encoding destination_encoding function object CONVERSIONS = \ *************** *** 86,91 **** --- 86,93 ---- koi8_r_to_utf8 KOI8R UTF8 koi8r_to_utf8 utf8_and_cyrillic \ utf8_to_windows_1251 UTF8 WIN1251 utf8_to_win1251 utf8_and_cyrillic \ windows_1251_to_utf8 WIN1251 UTF8 win1251_to_utf8 utf8_and_cyrillic \ + utf8_to_windows_1252 UTF8 WIN1252 utf8_to_win1252 utf8_and_win1252 \ + windows_1252_to_utf8 WIN1252 UTF8 win1252_to_utf8 utf8_and_win1252 \ utf8_to_windows_866 UTF8 WIN866 utf8_to_win866 utf8_and_cyrillic \ windows_866_to_utf8 WIN866 UTF8 win866_to_utf8 utf8_and_cyrillic \ euc_cn_to_utf8 EUC_CN UTF8 euc_cn_to_utf8 utf8_and_euc_cn \ *************** *** 136,147 **** utf8_to_win1258 UTF8 WIN1258 utf8_to_win1258 utf8_and_win1258 \ uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \ utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \ ! utf8_to_windows_1250 UTF8 WIN1250 utf_to_win1250 utf8_and_win1250 \ ! windows_1250_to_utf8 WIN1250 UTF8 win1250_to_utf utf8_and_win1250 \ ! utf8_to_windows_1256 UTF8 WIN1256 utf_to_win1256 utf8_and_win1256 \ ! windows_1256_to_utf8 WIN1256 UTF8 win1256_to_utf utf8_and_win1256 \ ! utf8_to_windows_874 UTF8 WIN874 utf_to_win874 utf8_and_win874 \ ! windows_874_to_utf8 WIN874 UTF8 win874_to_utf utf8_and_win874 all: $(SQLSCRIPT) @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done --- 138,149 ---- utf8_to_win1258 UTF8 WIN1258 utf8_to_win1258 utf8_and_win1258 \ uhc_to_utf8 UHC UTF8 uhc_to_utf8 utf8_and_uhc \ utf8_to_uhc UTF8 UHC utf8_to_uhc utf8_and_uhc \ ! utf8_to_windows_1250 UTF8 WIN1250 utf8_to_win1250 utf8_and_win1250 \ ! windows_1250_to_utf8 WIN1250 UTF8 win1250_to_utf8 utf8_and_win1250 \ ! utf8_to_windows_1256 UTF8 WIN1256 utf8_to_win1256 utf8_and_win1256 \ ! windows_1256_to_utf8 WIN1256 UTF8 win1256_to_utf8 utf8_and_win1256 \ ! utf8_to_windows_874 UTF8 WIN874 utf8_to_win874 utf8_and_win874 \ ! windows_874_to_utf8 WIN874 UTF8 win874_to_utf8 utf8_and_win874 all: $(SQLSCRIPT) @for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done Index: src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v retrieving revision 1.12 diff -c -c -r1.12 utf8_and_iso8859.c *** src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c 7 Mar 2005 04:30:54 -0000 1.12 --- src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c 14 Mar 2005 18:10:31 -0000 *************** *** 108,114 **** {PG_WIN1258}, /* Windows-1258 */ {PG_WIN874}, /* windows-874 */ {PG_KOI8R}, /* KOI8-R */ ! {PG_WIN1251}, /* windows-1251 (was: WIN) */ {PG_WIN866}, /* (MS-DOS CP866) */ {PG_ISO_8859_5, LUmapISO8859_5, ULmapISO8859_5, sizeof(LUmapISO8859_5) / sizeof(pg_local_to_utf), --- 108,114 ---- {PG_WIN1258}, /* Windows-1258 */ {PG_WIN874}, /* windows-874 */ {PG_KOI8R}, /* KOI8-R */ ! {PG_WIN1251}, /* windows-1251 */ {PG_WIN866}, /* (MS-DOS CP866) */ {PG_ISO_8859_5, LUmapISO8859_5, ULmapISO8859_5, sizeof(LUmapISO8859_5) / sizeof(pg_local_to_utf), Index: src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c,v retrieving revision 1.10 diff -c -c -r1.10 utf8_and_win1250.c *** src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c 7 Mar 2005 04:30:54 -0000 1.10 --- src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c 14 Mar 2005 18:10:32 -0000 *************** *** 17,27 **** #include "../../Unicode/utf8_to_win1250.map" #include "../../Unicode/win1250_to_utf8.map" ! PG_FUNCTION_INFO_V1(utf_to_win1250); ! PG_FUNCTION_INFO_V1(win1250_to_utf); ! extern Datum utf_to_win1250(PG_FUNCTION_ARGS); ! extern Datum win1250_to_utf(PG_FUNCTION_ARGS); /* ---------- * conv_proc( --- 17,27 ---- #include "../../Unicode/utf8_to_win1250.map" #include "../../Unicode/win1250_to_utf8.map" ! PG_FUNCTION_INFO_V1(utf8_to_win1250); ! PG_FUNCTION_INFO_V1(win1250_to_utf8); ! extern Datum utf8_to_win1250(PG_FUNCTION_ARGS); ! extern Datum win1250_to_utf8(PG_FUNCTION_ARGS); /* ---------- * conv_proc( *************** *** 35,41 **** */ Datum ! utf_to_win1250(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); --- 35,41 ---- */ Datum ! utf8_to_win1250(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); *************** *** 52,58 **** } Datum ! win1250_to_utf(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); --- 52,58 ---- } Datum ! win1250_to_utf8(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); Index: src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c,v retrieving revision 1.10 diff -c -c -r1.10 utf8_and_win1256.c *** src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c 7 Mar 2005 04:30:54 -0000 1.10 --- src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c 14 Mar 2005 18:10:32 -0000 *************** *** 17,27 **** #include "../../Unicode/utf8_to_win1256.map" #include "../../Unicode/win1256_to_utf8.map" ! PG_FUNCTION_INFO_V1(utf_to_win1256); ! PG_FUNCTION_INFO_V1(win1256_to_utf); ! extern Datum utf_to_win1256(PG_FUNCTION_ARGS); ! extern Datum win1256_to_utf(PG_FUNCTION_ARGS); /* ---------- * conv_proc( --- 17,27 ---- #include "../../Unicode/utf8_to_win1256.map" #include "../../Unicode/win1256_to_utf8.map" ! PG_FUNCTION_INFO_V1(utf8_to_win1256); ! PG_FUNCTION_INFO_V1(win1256_to_utf8); ! extern Datum utf8_to_win1256(PG_FUNCTION_ARGS); ! extern Datum win1256_to_utf8(PG_FUNCTION_ARGS); /* ---------- * conv_proc( *************** *** 35,41 **** */ Datum ! utf_to_win1256(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); --- 35,41 ---- */ Datum ! utf8_to_win1256(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); *************** *** 52,58 **** } Datum ! win1256_to_utf(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); --- 52,58 ---- } Datum ! win1256_to_utf8(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); Index: src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c,v retrieving revision 1.10 diff -c -c -r1.10 utf8_and_win874.c *** src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c 7 Mar 2005 04:30:55 -0000 1.10 --- src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c 14 Mar 2005 18:10:32 -0000 *************** *** 17,27 **** #include "../../Unicode/utf8_to_win874.map" #include "../../Unicode/win874_to_utf8.map" ! PG_FUNCTION_INFO_V1(utf_to_win874); ! PG_FUNCTION_INFO_V1(win874_to_utf); ! extern Datum utf_to_win874(PG_FUNCTION_ARGS); ! extern Datum win874_to_utf(PG_FUNCTION_ARGS); /* ---------- * conv_proc( --- 17,27 ---- #include "../../Unicode/utf8_to_win874.map" #include "../../Unicode/win874_to_utf8.map" ! PG_FUNCTION_INFO_V1(utf8_to_win874); ! PG_FUNCTION_INFO_V1(win874_to_utf8); ! extern Datum utf8_to_win874(PG_FUNCTION_ARGS); ! extern Datum win874_to_utf8(PG_FUNCTION_ARGS); /* ---------- * conv_proc( *************** *** 35,41 **** */ Datum ! utf_to_win874(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); --- 35,41 ---- */ Datum ! utf8_to_win874(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); *************** *** 52,58 **** } Datum ! win874_to_utf(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); --- 52,58 ---- } Datum ! win874_to_utf8(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); Index: src/bin/initdb/initdb.c =================================================================== RCS file: /cvsroot/pgsql/src/bin/initdb/initdb.c,v retrieving revision 1.78 diff -c -c -r1.78 initdb.c *** src/bin/initdb/initdb.c 11 Mar 2005 15:36:27 -0000 1.78 --- src/bin/initdb/initdb.c 14 Mar 2005 18:10:32 -0000 *************** *** 764,769 **** --- 764,770 ---- {PG_LATIN10, "ISO8859-16"}, {PG_LATIN10, "iso885916"}, + {PG_WIN1252, "CP1252"}, {PG_WIN1256, "CP1256"}, {PG_WIN1258, "CP1258"}, #ifdef NOT_VERIFIED Index: src/include/mb/pg_wchar.h =================================================================== RCS file: /cvsroot/pgsql/src/include/mb/pg_wchar.h,v retrieving revision 1.57 diff -c -c -r1.57 pg_wchar.h *** src/include/mb/pg_wchar.h 7 Mar 2005 04:30:55 -0000 1.57 --- src/include/mb/pg_wchar.h 14 Mar 2005 18:10:33 -0000 *************** *** 172,178 **** PG_WIN866, /* (MS-DOS CP866) */ PG_WIN874, /* windows-874 */ PG_KOI8R, /* KOI8-R */ ! PG_WIN1251, /* windows-1251 (was: WIN) */ PG_ISO_8859_5, /* ISO-8859-5 */ PG_ISO_8859_6, /* ISO-8859-6 */ PG_ISO_8859_7, /* ISO-8859-7 */ --- 172,179 ---- PG_WIN866, /* (MS-DOS CP866) */ PG_WIN874, /* windows-874 */ PG_KOI8R, /* KOI8-R */ ! PG_WIN1251, /* windows-1251 */ ! PG_WIN1252, /* windows-1252 */ PG_ISO_8859_5, /* ISO-8859-5 */ PG_ISO_8859_6, /* ISO-8859-6 */ PG_ISO_8859_7, /* ISO-8859-7 */ Index: src/test/regress/expected/conversion.out =================================================================== RCS file: /cvsroot/pgsql/src/test/regress/expected/conversion.out,v retrieving revision 1.10 diff -c -c -r1.10 conversion.out *** src/test/regress/expected/conversion.out 7 Mar 2005 04:30:55 -0000 1.10 --- src/test/regress/expected/conversion.out 14 Mar 2005 18:10:35 -0000 *************** *** 784,789 **** --- 784,815 ---- foo (1 row) + -- UTF8 --> WIN1252 + SELECT CONVERT('foo' USING utf8_to_windows_1252); + convert_using + --------------- + foo + (1 row) + + SELECT CONVERT('foo', 'UTF8', 'WIN1252'); + convert + --------- + foo + (1 row) + + -- WIN1252 --> UTF8 + SELECT CONVERT('foo' USING windows_1252_to_utf8); + convert_using + --------------- + foo + (1 row) + + SELECT CONVERT('foo', 'WIN1252', 'UTF8'); + convert + --------- + foo + (1 row) + -- UTF8 --> WIN866 SELECT CONVERT('foo' USING utf8_to_windows_866); convert_using Index: src/test/regress/sql/conversion.sql =================================================================== RCS file: /cvsroot/pgsql/src/test/regress/sql/conversion.sql,v retrieving revision 1.7 diff -c -c -r1.7 conversion.sql *** src/test/regress/sql/conversion.sql 7 Mar 2005 04:30:55 -0000 1.7 --- src/test/regress/sql/conversion.sql 14 Mar 2005 18:10:35 -0000 *************** *** 201,206 **** --- 201,212 ---- -- WIN1251 --> UTF8 SELECT CONVERT('foo' USING windows_1251_to_utf8); SELECT CONVERT('foo', 'WIN1251', 'UTF8'); + -- UTF8 --> WIN1252 + SELECT CONVERT('foo' USING utf8_to_windows_1252); + SELECT CONVERT('foo', 'UTF8', 'WIN1252'); + -- WIN1252 --> UTF8 + SELECT CONVERT('foo' USING windows_1252_to_utf8); + SELECT CONVERT('foo', 'WIN1252', 'UTF8'); -- UTF8 --> WIN866 SELECT CONVERT('foo' USING utf8_to_windows_866); SELECT CONVERT('foo', 'UTF8', 'WIN866');