From e3d7de6b995a33ee5b6205c6e4fd4078b103af45 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 7 Mar 2005 04:30:55 +0000 Subject: [PATCH] Rename canonical encodings, per Peter: UNICODE => UTF8 ALT => WIN866 WIN => WIN1251 TCVN => WIN1258 The old codes continue to work. --- doc/README.mb.jp | 2 +- doc/TODO | 2 +- doc/src/sgml/charset.sgml | 104 ++--- doc/src/sgml/func.sgml | 310 ++++++------- doc/src/sgml/ref/alter_conversion.sgml | 10 +- doc/src/sgml/ref/comment.sgml | 4 +- doc/src/sgml/ref/create_conversion.sgml | 6 +- src/backend/utils/adt/selfuncs.c | 4 +- src/backend/utils/mb/Unicode/Makefile | 6 +- src/backend/utils/mb/Unicode/UCS_to_8859.pl | 6 +- src/backend/utils/mb/Unicode/UCS_to_BIG5.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl | 8 +- src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl | 4 +- .../utils/mb/Unicode/UCS_to_GB18030.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_GBK.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_SJIS.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_UHC.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_WIN874.pl | 4 +- src/backend/utils/mb/Unicode/UCS_to_WINX.pl | 6 +- .../utils/mb/Unicode/UCS_to_cyrillic.pl | 10 +- .../{utf8_to_tcvn.map => utf8_to_win1258.map} | 2 +- .../{utf8_to_alt.map => utf8_to_win866.map} | 2 +- .../{tcvn_to_utf8.map => win1258_to_utf8.map} | 2 +- .../{alt_to_utf8.map => win866_to_utf8.map} | 2 +- src/backend/utils/mb/conv.c | 14 +- .../utils/mb/conversion_procs/Makefile | 148 +++--- .../cyrillic_and_mic/cyrillic_and_mic.c | 104 ++--- .../utils/mb/conversion_procs/regress_prolog | 8 +- .../utf8_and_ascii/utf8_and_ascii.c | 4 +- .../utf8_and_big5/utf8_and_big5.c | 4 +- .../utf8_and_cyrillic/utf8_and_cyrillic.c | 30 +- .../utf8_and_euc_cn/utf8_and_euc_cn.c | 4 +- .../utf8_and_euc_jp/utf8_and_euc_jp.c | 4 +- .../utf8_and_euc_kr/utf8_and_euc_kr.c | 4 +- .../utf8_and_euc_tw/utf8_and_euc_tw.c | 4 +- .../utf8_and_gb18030/utf8_and_gb18030.c | 4 +- .../utf8_and_gbk/utf8_and_gbk.c | 4 +- .../utf8_and_iso8859/utf8_and_iso8859.c | 14 +- .../utf8_and_iso8859_1/utf8_and_iso8859_1.c | 6 +- .../utf8_and_johab/utf8_and_johab.c | 4 +- .../utf8_and_sjis/utf8_and_sjis.c | 4 +- .../utf8_and_uhc/utf8_and_uhc.c | 4 +- .../utf8_and_win1250/utf8_and_win1250.c | 4 +- .../utf8_and_win1256/utf8_and_win1256.c | 4 +- .../Makefile | 4 +- .../utf8_and_win1258.c} | 32 +- .../utf8_and_win874/utf8_and_win874.c | 4 +- src/backend/utils/mb/encnames.c | 51 ++- src/backend/utils/mb/mbutils.c | 4 +- src/backend/utils/mb/wchar.c | 12 +- src/backend/utils/mb/win.c | 74 --- src/backend/utils/mb/{alt.c => win866.c} | 2 +- src/bin/initdb/initdb.c | 8 +- src/include/mb/pg_wchar.h | 16 +- src/test/mb/mbregress.sh | 6 +- src/test/regress/expected/conversion.out | 426 +++++++++--------- src/test/regress/sql/conversion.sql | 424 ++++++++--------- 60 files changed, 950 insertions(+), 1015 deletions(-) rename src/backend/utils/mb/Unicode/{utf8_to_tcvn.map => utf8_to_win1258.map} (98%) rename src/backend/utils/mb/Unicode/{utf8_to_alt.map => utf8_to_win866.map} (98%) rename src/backend/utils/mb/Unicode/{tcvn_to_utf8.map => win1258_to_utf8.map} (98%) rename src/backend/utils/mb/Unicode/{alt_to_utf8.map => win866_to_utf8.map} (98%) rename src/backend/utils/mb/conversion_procs/{utf8_and_tcvn => utf8_and_win1258}/Makefile (81%) rename src/backend/utils/mb/conversion_procs/{utf8_and_tcvn/utf8_and_tcvn.c => utf8_and_win1258/utf8_and_win1258.c} (62%) delete mode 100644 src/backend/utils/mb/win.c rename src/backend/utils/mb/{alt.c => win866.c} (91%) diff --git a/doc/README.mb.jp b/doc/README.mb.jp index 6cb15c8883..7cafb2426e 100644 --- a/doc/README.mb.jp +++ b/doc/README.mb.jp @@ -299,7 +299,7 @@ o set client_encoding コマンドを使う方法 PostgreSQLのCONVERTと機能はほとんど同じですが,呼び出し形式が異りま す. - SELECT convert(text using euc_jp_to_utf_8) FROM unicode_tbl; + SELECT convert(text using euc_jp_to_utf8) FROM unicode_tbl; "using" の後の引数は「コンバージョン名」です.この例では,EUC_JP か ら UTF-8 に変換するコンバージョンを指定しています.定義済のコンバー diff --git a/doc/TODO b/doc/TODO index 2ff090c75a..3fa8cc6148 100644 --- a/doc/TODO +++ b/doc/TODO @@ -215,7 +215,7 @@ Multi-Language Support * Optimize locale to have minimal performance impact when not used * Support multiple simultaneous character sets, per SQL92 -* Improve Unicode combined character handling (?) +* Improve UTF8 combined character handling (?) * Add octet_length_server() and octet_length_client() * Make octet_length_client() the same as octet_length()? diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index 0b9aa697f3..f8e347c65e 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -1,4 +1,4 @@ - + Localization</> @@ -285,7 +285,7 @@ initdb --locale=sv_SE allows you to store text in a variety of character sets, including single-byte character sets such as the ISO 8859 series and multiple-byte character sets such as <acronym>EUC</> (Extended Unix - Code), Unicode, and Mule internal code. All character sets can be + Code), UTF8, and Mule internal code. All character sets can be used transparently throughout the server. (If you use extension functions from other sources, it depends on whether they wrote their code correctly.) The default character set is selected while @@ -339,8 +339,8 @@ initdb --locale=sv_SE <entry>Taiwan <acronym>EUC</acronym></entry> </row> <row> - <entry><literal>UNICODE</literal></entry> - <entry>Unicode (<acronym>UTF</acronym>-8)</entry> + <entry><literal>UTF8</literal></entry> + <entry>UTF-8 (Unicode, 8-bit)</entry> </row> <row> <entry><literal>MULE_INTERNAL</literal></entry> @@ -407,7 +407,7 @@ initdb --locale=sv_SE <entry><acronym>KOI</acronym>8-R(U)</entry> </row> <row> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> <entry>Windows CP866</entry> </row> <row> @@ -419,7 +419,7 @@ initdb --locale=sv_SE <entry>Windows CP1250</entry> </row> <row> - <entry><literal>WIN</literal></entry> + <entry><literal>WIN1251</literal></entry> <entry>Windows CP1251</entry> </row> <row> @@ -427,8 +427,8 @@ initdb --locale=sv_SE <entry>Windows CP1256 (Arabic)</entry> </row> <row> - <entry><literal>TCVN</literal></entry> - <entry><acronym>TCVN</>-5712/Windows CP1258 (Vietnamese)</entry> + <entry><literal>WIN1258</literal></entry> + <entry>Windows CP1258 (Vietnamese)/<acronym>TCVN</>-5712</entry> </row> </tbody> </tgroup> @@ -504,7 +504,7 @@ $ <userinput>psql -l</userinput> regression | t-ishii | SQL_ASCII template1 | t-ishii | EUC_JP test | t-ishii | EUC_JP - unicode | t-ishii | UNICODE + utf8 | t-ishii | UTF8 (9 rows) </screen> </para> @@ -561,126 +561,126 @@ $ <userinput>psql -l</userinput> <tbody> <row> <entry><literal>SQL_ASCII</literal></entry> - <entry><literal>SQL_ASCII</literal>, <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <entry><literal>SQL_ASCII</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>EUC_JP</literal></entry> <entry><literal>EUC_JP</literal>, <literal>SJIS</literal>, - <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>EUC_CN</literal></entry> - <entry><literal>EUC_CN</literal>, <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <entry><literal>EUC_CN</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>EUC_KR</literal></entry> - <entry><literal>EUC_KR</literal>, <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <entry><literal>EUC_KR</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>JOHAB</literal></entry> - <entry><literal>JOHAB</literal>, <literal>UNICODE</literal> + <entry><literal>JOHAB</literal>, <literal>UTF8</literal> </entry> </row> <row> <entry><literal>EUC_TW</literal></entry> <entry><literal>EUC_TW</literal>, <literal>BIG5</literal>, - <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN1</literal></entry> - <entry><literal>LATIN1</literal>, <literal>UNICODE</literal> + <entry><literal>LATIN1</literal>, <literal>UTF8</literal> <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN2</literal></entry> <entry><literal>LATIN2</literal>, <literal>WIN1250</literal>, - <literal>UNICODE</literal>, + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN3</literal></entry> - <entry><literal>LATIN3</literal>, <literal>UNICODE</literal>, + <entry><literal>LATIN3</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN4</literal></entry> - <entry><literal>LATIN4</literal>, <literal>UNICODE</literal>, + <entry><literal>LATIN4</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN5</literal></entry> - <entry><literal>LATIN5</literal>, <literal>UNICODE</literal> + <entry><literal>LATIN5</literal>, <literal>UTF8</literal> </entry> </row> <row> <entry><literal>LATIN6</literal></entry> - <entry><literal>LATIN6</literal>, <literal>UNICODE</literal>, + <entry><literal>LATIN6</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN7</literal></entry> - <entry><literal>LATIN7</literal>, <literal>UNICODE</literal>, + <entry><literal>LATIN7</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN8</literal></entry> - <entry><literal>LATIN8</literal>, <literal>UNICODE</literal>, + <entry><literal>LATIN8</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN9</literal></entry> - <entry><literal>LATIN9</literal>, <literal>UNICODE</literal>, + <entry><literal>LATIN9</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>LATIN10</literal></entry> - <entry><literal>LATIN10</literal>, <literal>UNICODE</literal>, + <entry><literal>LATIN10</literal>, <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>ISO_8859_5</literal></entry> <entry><literal>ISO_8859_5</literal>, - <literal>UNICODE</literal>, + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal>, - <literal>WIN</literal>, - <literal>ALT</literal>, + <literal>WIN1251</literal>, + <literal>WIN866</literal>, <literal>KOI8</literal> </entry> </row> <row> <entry><literal>ISO_8859_6</literal></entry> <entry><literal>ISO_8859_6</literal>, - <literal>UNICODE</literal> + <literal>UTF8</literal> </entry> </row> <row> <entry><literal>ISO_8859_7</literal></entry> <entry><literal>ISO_8859_7</literal>, - <literal>UNICODE</literal> + <literal>UTF8</literal> </entry> </row> <row> <entry><literal>ISO_8859_8</literal></entry> <entry><literal>ISO_8859_8</literal>, - <literal>UNICODE</literal> + <literal>UTF8</literal> </entry> </row> <row> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> <entry> <literal>EUC_JP</literal>, <literal>SJIS</literal>, <literal>EUC_KR</literal>, <literal>UHC</literal>, <literal>JOHAB</literal>, @@ -691,10 +691,10 @@ $ <userinput>psql -l</userinput> <literal>ISO_8859_6</literal>, <literal>ISO_8859_7</literal>, <literal>ISO_8859_8</literal>, - <literal>WIN</literal>, <literal>ALT</literal>, + <literal>WIN1251</literal>, <literal>WIN866</literal>, <literal>KOI8</literal>, <literal>WIN1256</literal>, - <literal>TCVN</literal>, + <literal>WIN1258</literal>, <literal>WIN874</literal>, <literal>GB18030</literal>, <literal>WIN1250</literal> @@ -704,53 +704,53 @@ $ <userinput>psql -l</userinput> <entry><literal>MULE_INTERNAL</literal></entry> <entry><literal>EUC_JP</literal>, <literal>SJIS</literal>, <literal>EUC_KR</literal>, <literal>EUC_CN</literal>, <literal>EUC_TW</literal>, <literal>BIG5</literal>, <literal>LATIN1</literal> to <literal>LATIN5</literal>, - <literal>WIN</literal>, <literal>ALT</literal>, + <literal>WIN1251</literal>, <literal>WIN866</literal>, <literal>WIN1250</literal>, <literal>BIG5</literal>, <literal>ISO_8859_5</literal>, <literal>KOI8</literal></entry> </row> <row> <entry><literal>KOI8</literal></entry> - <entry><literal>ISO_8859_5</literal>, <literal>WIN</literal>, - <literal>ALT</literal>, <literal>KOI8</literal>, - <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <entry><literal>ISO_8859_5</literal>, <literal>WIN1251</literal>, + <literal>WIN866</literal>, <literal>KOI8</literal>, + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> - <entry><literal>ALT</literal></entry> - <entry><literal>ISO_8859_5</literal>, <literal>WIN</literal>, - <literal>ALT</literal>, <literal>KOI8</literal>, - <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <entry><literal>WIN866</literal></entry> + <entry><literal>ISO_8859_5</literal>, <literal>WIN1251</literal>, + <literal>WIN866</literal>, <literal>KOI8</literal>, + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>WIN874</literal></entry> <entry><literal>WIN874</literal>, - <literal>UNICODE</literal> + <literal>UTF8</literal> </entry> </row> <row> <entry><literal>WIN1250</literal></entry> <entry><literal>LATIN2</literal>, <literal>WIN1250</literal>, - <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> - <entry><literal>WIN</literal></entry> - <entry><literal>ISO_8859_5</literal>, <literal>WIN</literal>, - <literal>ALT</literal>, <literal>KOI8</literal>, - <literal>UNICODE</literal>, <literal>MULE_INTERNAL</literal> + <entry><literal>WIN1251</literal></entry> + <entry><literal>ISO_8859_5</literal>, <literal>WIN1251</literal>, + <literal>WIN866</literal>, <literal>KOI8</literal>, + <literal>UTF8</literal>, <literal>MULE_INTERNAL</literal> </entry> </row> <row> <entry><literal>WIN1256</literal></entry> <entry><literal>WIN1256</literal>, - <literal>UNICODE</literal> + <literal>UTF8</literal> </entry> </row> <row> - <entry><literal>TCVN</literal></entry> - <entry><literal>TCVN</literal>, - <literal>UNICODE</literal> + <entry><literal>WIN1258</literal></entry> + <entry><literal>WIN1258</literal>, + <literal>UTF8</literal> </entry> </row> </tbody> diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index f6c33eaa0e..7da2e8ad4a 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.239 2005/02/28 03:45:20 neilc Exp $ +$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.240 2005/03/07 04:30:49 momjian Exp $ PostgreSQL documentation --> @@ -933,8 +933,8 @@ PostgreSQL documentation linkend="conversion-names"> for available conversion names. </entry> - <entry><literal>convert('PostgreSQL' using iso_8859_1_to_utf_8)</literal></entry> - <entry><literal>'PostgreSQL'</literal> in Unicode (UTF-8) encoding</entry> + <entry><literal>convert('PostgreSQL' using iso_8859_1_to_utf8)</literal></entry> + <entry><literal>'PostgreSQL'</literal> in UTF8 (Unicode, 8-bit) encoding</entry> </row> <row> @@ -1105,8 +1105,8 @@ PostgreSQL documentation <parameter>src_encoding</parameter> is omitted, database encoding is assumed. </entry> - <entry><literal>convert( 'text_in_unicode', 'UNICODE', 'LATIN1')</literal></entry> - <entry><literal>text_in_unicode</literal> represented in ISO 8859-1 encoding</entry> + <entry><literal>convert( 'text_in_utf8', 'UTF8', 'LATIN1')</literal></entry> + <entry><literal>text_in_utf8</literal> represented in ISO 8859-1 encoding</entry> </row> <row> @@ -1421,9 +1421,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>ascii_to_utf_8</literal></entry> + <entry><literal>ascii_to_utf8</literal></entry> <entry><literal>SQL_ASCII</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1439,9 +1439,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>big5_to_utf_8</literal></entry> + <entry><literal>big5_to_utf8</literal></entry> <entry><literal>BIG5</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1451,9 +1451,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>euc_cn_to_utf_8</literal></entry> + <entry><literal>euc_cn_to_utf8</literal></entry> <entry><literal>EUC_CN</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1469,9 +1469,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>euc_jp_to_utf_8</literal></entry> + <entry><literal>euc_jp_to_utf8</literal></entry> <entry><literal>EUC_JP</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1481,9 +1481,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>euc_kr_to_utf_8</literal></entry> + <entry><literal>euc_kr_to_utf8</literal></entry> <entry><literal>EUC_KR</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1499,51 +1499,51 @@ PostgreSQL documentation </row> <row> - <entry><literal>euc_tw_to_utf_8</literal></entry> + <entry><literal>euc_tw_to_utf8</literal></entry> <entry><literal>EUC_TW</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>gb18030_to_utf_8</literal></entry> + <entry><literal>gb18030_to_utf8</literal></entry> <entry><literal>GB18030</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>gbk_to_utf_8</literal></entry> + <entry><literal>gbk_to_utf8</literal></entry> <entry><literal>GBK</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_10_to_utf_8</literal></entry> + <entry><literal>iso_8859_10_to_utf8</literal></entry> <entry><literal>LATIN6</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_13_to_utf_8</literal></entry> + <entry><literal>iso_8859_13_to_utf8</literal></entry> <entry><literal>LATIN7</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_14_to_utf_8</literal></entry> + <entry><literal>iso_8859_14_to_utf8</literal></entry> <entry><literal>LATIN8</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_15_to_utf_8</literal></entry> + <entry><literal>iso_8859_15_to_utf8</literal></entry> <entry><literal>LATIN9</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_16_to_utf_8</literal></entry> + <entry><literal>iso_8859_16_to_utf8</literal></entry> <entry><literal>LATIN10</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1553,9 +1553,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>iso_8859_1_to_utf_8</literal></entry> + <entry><literal>iso_8859_1_to_utf8</literal></entry> <entry><literal>LATIN1</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1565,9 +1565,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>iso_8859_2_to_utf_8</literal></entry> + <entry><literal>iso_8859_2_to_utf8</literal></entry> <entry><literal>LATIN2</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1583,9 +1583,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>iso_8859_3_to_utf_8</literal></entry> + <entry><literal>iso_8859_3_to_utf8</literal></entry> <entry><literal>LATIN3</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1595,9 +1595,9 @@ PostgreSQL documentation </row> <row> - <entry><literal>iso_8859_4_to_utf_8</literal></entry> + <entry><literal>iso_8859_4_to_utf8</literal></entry> <entry><literal>LATIN4</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1613,51 +1613,51 @@ PostgreSQL documentation </row> <row> - <entry><literal>iso_8859_5_to_utf_8</literal></entry> + <entry><literal>iso_8859_5_to_utf8</literal></entry> <entry><literal>ISO_8859_5</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> <entry><literal>iso_8859_5_to_windows_1251</literal></entry> <entry><literal>ISO_8859_5</literal></entry> - <entry><literal>WIN</literal></entry> + <entry><literal>WIN1251</literal></entry> </row> <row> <entry><literal>iso_8859_5_to_windows_866</literal></entry> <entry><literal>ISO_8859_5</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> </row> <row> - <entry><literal>iso_8859_6_to_utf_8</literal></entry> + <entry><literal>iso_8859_6_to_utf8</literal></entry> <entry><literal>ISO_8859_6</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_7_to_utf_8</literal></entry> + <entry><literal>iso_8859_7_to_utf8</literal></entry> <entry><literal>ISO_8859_7</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_8_to_utf_8</literal></entry> + <entry><literal>iso_8859_8_to_utf8</literal></entry> <entry><literal>ISO_8859_8</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>iso_8859_9_to_utf_8</literal></entry> + <entry><literal>iso_8859_9_to_utf8</literal></entry> <entry><literal>LATIN5</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>johab_to_utf_8</literal></entry> + <entry><literal>johab_to_utf8</literal></entry> <entry><literal>JOHAB</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> @@ -1673,21 +1673,21 @@ PostgreSQL documentation </row> <row> - <entry><literal>koi8_r_to_utf_8</literal></entry> + <entry><literal>koi8_r_to_utf8</literal></entry> <entry><literal>KOI8</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> <entry><literal>koi8_r_to_windows_1251</literal></entry> <entry><literal>KOI8</literal></entry> - <entry><literal>WIN</literal></entry> + <entry><literal>WIN1251</literal></entry> </row> <row> <entry><literal>koi8_r_to_windows_866</literal></entry> <entry><literal>KOI8</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> </row> <row> @@ -1777,13 +1777,13 @@ PostgreSQL documentation <row> <entry><literal>mic_to_windows_1251</literal></entry> <entry><literal>MULE_INTERNAL</literal></entry> - <entry><literal>WIN</literal></entry> + <entry><literal>WIN1251</literal></entry> </row> <row> <entry><literal>mic_to_windows_866</literal></entry> <entry><literal>MULE_INTERNAL</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> </row> <row> @@ -1799,212 +1799,212 @@ PostgreSQL documentation </row> <row> - <entry><literal>sjis_to_utf_8</literal></entry> + <entry><literal>sjis_to_utf8</literal></entry> <entry><literal>SJIS</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>tcvn_to_utf_8</literal></entry> - <entry><literal>TCVN</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>tcvn_to_utf8</literal></entry> + <entry><literal>WIN1258</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>uhc_to_utf_8</literal></entry> + <entry><literal>uhc_to_utf8</literal></entry> <entry><literal>UHC</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> - <entry><literal>utf_8_to_ascii</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_ascii</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>SQL_ASCII</literal></entry> </row> <row> - <entry><literal>utf_8_to_big5</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_big5</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>BIG5</literal></entry> </row> <row> - <entry><literal>utf_8_to_euc_cn</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_euc_cn</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>EUC_CN</literal></entry> </row> <row> - <entry><literal>utf_8_to_euc_jp</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_euc_jp</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>EUC_JP</literal></entry> </row> <row> - <entry><literal>utf_8_to_euc_kr</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_euc_kr</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>EUC_KR</literal></entry> </row> <row> - <entry><literal>utf_8_to_euc_tw</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_euc_tw</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>EUC_TW</literal></entry> </row> <row> - <entry><literal>utf_8_to_gb18030</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_gb18030</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>GB18030</literal></entry> </row> <row> - <entry><literal>utf_8_to_gbk</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_gbk</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>GBK</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_1</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_1</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN1</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_10</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_10</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN6</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_13</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_13</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN7</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_14</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_14</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN8</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_15</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_15</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN9</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_16</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_16</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN10</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_2</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_2</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN2</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_3</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_3</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN3</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_4</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_4</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN4</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_5</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_5</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>ISO_8859_5</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_6</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_6</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>ISO_8859_6</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_7</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_7</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>ISO_8859_7</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_8</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_8</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>ISO_8859_8</literal></entry> </row> <row> - <entry><literal>utf_8_to_iso_8859_9</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_iso_8859_9</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>LATIN5</literal></entry> </row> <row> - <entry><literal>utf_8_to_johab</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_johab</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>JOHAB</literal></entry> </row> <row> - <entry><literal>utf_8_to_koi8_r</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_koi8_r</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>KOI8</literal></entry> </row> <row> - <entry><literal>utf_8_to_sjis</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_sjis</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>SJIS</literal></entry> </row> <row> - <entry><literal>utf_8_to_tcvn</literal></entry> - <entry><literal>UNICODE</literal></entry> - <entry><literal>TCVN</literal></entry> + <entry><literal>utf8_to_tcvn</literal></entry> + <entry><literal>UTF8</literal></entry> + <entry><literal>WIN1258</literal></entry> </row> <row> - <entry><literal>utf_8_to_uhc</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_uhc</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>UHC</literal></entry> </row> <row> - <entry><literal>utf_8_to_windows_1250</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_windows_1250</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>WIN1250</literal></entry> </row> <row> - <entry><literal>utf_8_to_windows_1251</literal></entry> - <entry><literal>UNICODE</literal></entry> - <entry><literal>WIN</literal></entry> + <entry><literal>utf8_to_windows_1251</literal></entry> + <entry><literal>UTF8</literal></entry> + <entry><literal>WIN1251</literal></entry> </row> <row> - <entry><literal>utf_8_to_windows_1256</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_windows_1256</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>WIN1256</literal></entry> </row> <row> - <entry><literal>utf_8_to_windows_866</literal></entry> - <entry><literal>UNICODE</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>utf8_to_windows_866</literal></entry> + <entry><literal>UTF8</literal></entry> + <entry><literal>WIN866</literal></entry> </row> <row> - <entry><literal>utf_8_to_windows_874</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>utf8_to_windows_874</literal></entry> + <entry><literal>UTF8</literal></entry> <entry><literal>WIN874</literal></entry> </row> @@ -2021,81 +2021,81 @@ PostgreSQL documentation </row> <row> - <entry><literal>windows_1250_to_utf_8</literal></entry> + <entry><literal>windows_1250_to_utf8</literal></entry> <entry><literal>WIN1250</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> <entry><literal>windows_1251_to_iso_8859_5</literal></entry> - <entry><literal>WIN</literal></entry> + <entry><literal>WIN1251</literal></entry> <entry><literal>ISO_8859_5</literal></entry> </row> <row> <entry><literal>windows_1251_to_koi8_r</literal></entry> - <entry><literal>WIN</literal></entry> + <entry><literal>WIN1251</literal></entry> <entry><literal>KOI8</literal></entry> </row> <row> <entry><literal>windows_1251_to_mic</literal></entry> - <entry><literal>WIN</literal></entry> + <entry><literal>WIN1251</literal></entry> <entry><literal>MULE_INTERNAL</literal></entry> </row> <row> - <entry><literal>windows_1251_to_utf_8</literal></entry> - <entry><literal>WIN</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>windows_1251_to_utf8</literal></entry> + <entry><literal>WIN1251</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> <entry><literal>windows_1251_to_windows_866</literal></entry> - <entry><literal>WIN</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN1251</literal></entry> + <entry><literal>WIN866</literal></entry> </row> <row> - <entry><literal>windows_1256_to_utf_8</literal></entry> + <entry><literal>windows_1256_to_utf8</literal></entry> <entry><literal>WIN1256</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> <entry><literal>windows_866_to_iso_8859_5</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> <entry><literal>ISO_8859_5</literal></entry> </row> <row> <entry><literal>windows_866_to_koi8_r</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> <entry><literal>KOI8</literal></entry> </row> <row> <entry><literal>windows_866_to_mic</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> <entry><literal>MULE_INTERNAL</literal></entry> </row> <row> - <entry><literal>windows_866_to_utf_8</literal></entry> - <entry><literal>ALT</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>windows_866_to_utf8</literal></entry> + <entry><literal>WIN866</literal></entry> + <entry><literal>UTF8</literal></entry> </row> <row> <entry><literal>windows_866_to_windows_1251</literal></entry> - <entry><literal>ALT</literal></entry> + <entry><literal>WIN866</literal></entry> <entry><literal>WIN</literal></entry> </row> <row> - <entry><literal>windows_874_to_utf_8</literal></entry> + <entry><literal>windows_874_to_utf8</literal></entry> <entry><literal>WIN874</literal></entry> - <entry><literal>UNICODE</literal></entry> + <entry><literal>UTF8</literal></entry> </row> </tbody> @@ -3372,7 +3372,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation> <row> <entry> <literal>\u</><replaceable>wxyz</> </entry> <entry> (where <replaceable>wxyz</> is exactly four hexadecimal digits) - the Unicode character <literal>U+</><replaceable>wxyz</> + the UTF16 (Unicode, 16-bit) character <literal>U+</><replaceable>wxyz</> in the local byte ordering </entry> </row> diff --git a/doc/src/sgml/ref/alter_conversion.sgml b/doc/src/sgml/ref/alter_conversion.sgml index 024d03212c..dc86fcf681 100644 --- a/doc/src/sgml/ref/alter_conversion.sgml +++ b/doc/src/sgml/ref/alter_conversion.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/alter_conversion.sgml,v 1.5 2004/06/25 21:55:50 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/alter_conversion.sgml,v 1.6 2005/03/07 04:30:51 momjian Exp $ PostgreSQL documentation --> @@ -72,18 +72,18 @@ ALTER CONVERSION <replaceable>name</replaceable> OWNER TO <replaceable>newowner< <title>Examples - To rename the conversion iso_8859_1_to_utf_8 to + To rename the conversion iso_8859_1_to_utf8 to latin1_to_unicode: -ALTER CONVERSION iso_8859_1_to_utf_8 RENAME TO latin1_to_unicode; +ALTER CONVERSION iso_8859_1_to_utf8 RENAME TO latin1_to_unicode; - To change the owner of the conversion iso_8859_1_to_utf_8 to + To change the owner of the conversion iso_8859_1_to_utf8 to joe: -ALTER CONVERSION iso_8859_1_to_utf_8 OWNER TO joe; +ALTER CONVERSION iso_8859_1_to_utf8 OWNER TO joe; diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 4355e5fe2a..961623c3da 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -1,5 +1,5 @@ @@ -195,7 +195,7 @@ COMMENT ON TABLE mytable IS NULL; COMMENT ON AGGREGATE my_aggregate (double precision) IS 'Computes sample variance'; COMMENT ON CAST (text AS int4) IS 'Allow casts from text to int4'; COMMENT ON COLUMN my_table.my_column IS 'Employee ID number'; -COMMENT ON CONVERSION my_conv IS 'Conversion to Unicode'; +COMMENT ON CONVERSION my_conv IS 'Conversion to UTF8'; COMMENT ON DATABASE my_database IS 'Development Database'; COMMENT ON DOMAIN my_domain IS 'Email Address Domain'; COMMENT ON FUNCTION my_function (timestamp) IS 'Returns Roman Numeral'; diff --git a/doc/src/sgml/ref/create_conversion.sgml b/doc/src/sgml/ref/create_conversion.sgml index 371b5185dc..3b941b80bb 100644 --- a/doc/src/sgml/ref/create_conversion.sgml +++ b/doc/src/sgml/ref/create_conversion.sgml @@ -1,4 +1,4 @@ - + @@ -136,10 +136,10 @@ conv_proc( Examples - To create a conversion from encoding UNICODE to + To create a conversion from encoding UTF8 to LATIN1 using myfunc: -CREATE CONVERSION myconv FOR 'UNICODE' TO 'LATIN1' FROM myfunc; +CREATE CONVERSION myconv FOR 'UTF8' TO 'LATIN1' FROM myfunc; diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index c63eff09cd..ccbb0dfa8b 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.172 2005/03/06 22:15:04 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.173 2005/03/07 04:30:51 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -4035,7 +4035,7 @@ pattern_selectivity(Const *patt, Pattern_Type ptype) * * NOTE: at present this assumes we are in the C locale, so that simple * bytewise comparison applies. However, we might be in a multibyte - * encoding such as UTF-8, so we do have to watch out for generating + * encoding such as UTF8, so we do have to watch out for generating * invalid encoding sequences. */ Const * diff --git a/src/backend/utils/mb/Unicode/Makefile b/src/backend/utils/mb/Unicode/Makefile index ccc5051f90..ccf5ddedbd 100644 --- a/src/backend/utils/mb/Unicode/Makefile +++ b/src/backend/utils/mb/Unicode/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/Makefile,v 1.8 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/Makefile,v 1.9 2005/03/07 04:30:52 momjian Exp $ # #------------------------------------------------------------------------- @@ -18,8 +18,8 @@ ISO8859MAPS=iso8859_2_to_utf8.map iso8859_3_to_utf8.map \ utf8_to_iso8859_4.map utf8_to_iso8859_5.map -CYRILLICMAPS=koi8r_to_utf8.map win1251_to_utf8.map alt_to_utf8.map\ - utf8_to_koi8r.map utf8_to_win1251.map utf8_to_alt.map +CYRILLICMAPS=koi8r_to_utf8.map win1251_to_utf8.map win866_to_utf8.map\ + utf8_to_koi8r.map utf8_to_win1251.map utf8_to_win866.map MAPS= $(ISO8859MAPS) $(CYRILLICMAPS)\ big5_to_utf8.map euc_cn_to_utf8.map euc_jp_to_utf8.map \ diff --git a/src/backend/utils/mb/Unicode/UCS_to_8859.pl b/src/backend/utils/mb/Unicode/UCS_to_8859.pl index abf3dce94a..131b97129d 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_8859.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_8859.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_8859.pl,v 1.7 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_8859.pl,v 1.8 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> ISO8859 code conversion tables from # map files provided by Unicode organization. @@ -39,7 +39,7 @@ foreach $charset (@charsets) { if( $code >= 0x80){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; @@ -83,7 +83,7 @@ foreach $charset (@charsets) { if($code >= 0x80){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_BIG5.pl b/src/backend/utils/mb/Unicode/UCS_to_BIG5.pl index a3b2c63000..72e9f2c7a6 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_BIG5.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_BIG5.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_BIG5.pl,v 1.6 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_BIG5.pl,v 1.7 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> BIG5 code conversion tables from # map files provided by Unicode organization. @@ -35,7 +35,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl b/src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl index a4d0a2ccff..991dace217 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl,v 1.6 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl,v 1.7 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> EUC_CN code conversion tables from # map files provided by Unicode organization. @@ -35,7 +35,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl b/src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl index 13bbd6345c..30d8bfd530 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl,v 1.6 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl,v 1.7 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> EUC_JP code conversion tables from # map files provided by Unicode organization. @@ -51,7 +51,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; @@ -80,7 +80,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; @@ -108,7 +108,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl b/src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl index 96a80fc1f5..9f95488c84 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl,v 1.7 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl,v 1.8 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> EUC_KR code conversion tables from # map files provided by Unicode organization. @@ -35,7 +35,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl b/src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl index c3c6fb28b1..8c995385bc 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl,v 1.6 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl,v 1.7 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> EUC_TW code conversion tables from # map files provided by Unicode organization. @@ -36,7 +36,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_GB18030.pl b/src/backend/utils/mb/Unicode/UCS_to_GB18030.pl index 700bb08409..68dc87b498 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_GB18030.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_GB18030.pl @@ -2,7 +2,7 @@ # # Copyright 2002 by Bill Huang # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_GB18030.pl,v 1.4 2003/11/29 22:40:01 pgsql Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_GB18030.pl,v 1.5 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> GB18030 code conversion tables from # map files provided by Unicode organization. @@ -35,7 +35,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_GBK.pl b/src/backend/utils/mb/Unicode/UCS_to_GBK.pl index b65a322434..b8bc7eaaf4 100644 --- a/src/backend/utils/mb/Unicode/UCS_to_GBK.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_GBK.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_GBK.pl,v 1.5 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_GBK.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ # # # Generate UTF-8 <--> GBK code conversion tables from @@ -36,7 +36,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl b/src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl index df4b1abedd..6dbc5174c0 100644 --- a/src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl,v 1.5 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> JOHAB code conversion tables from # map files provided by Unicode organization. @@ -35,7 +35,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl b/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl index 9aed90566f..3fbef869f4 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl,v 1.7 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl,v 1.8 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> SJIS code conversion tables from # map files provided by Unicode organization. @@ -52,7 +52,7 @@ while( ){ || (( $code >= 0x879a ) && ( $code <= 0x879c ))) { - printf STDERR "Warning: duplicate unicode : UCS=0x%04x SJIS=0x%04x\n",$ucs,$code; + printf STDERR "Warning: duplicate UTF8 : UCS=0x%04x SJIS=0x%04x\n",$ucs,$code; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_UHC.pl b/src/backend/utils/mb/Unicode/UCS_to_UHC.pl index ebef4d8856..de518c4676 100644 --- a/src/backend/utils/mb/Unicode/UCS_to_UHC.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_UHC.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_UHC.pl,v 1.5 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_UHC.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> BIG5 code conversion tables from # map files provided by Unicode organization. @@ -35,7 +35,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_WIN874.pl b/src/backend/utils/mb/Unicode/UCS_to_WIN874.pl index 24846aa291..b53ca9f048 100644 --- a/src/backend/utils/mb/Unicode/UCS_to_WIN874.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_WIN874.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_WIN874.pl,v 1.5 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_WIN874.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> WIN874 code conversion tables from # map files provided by Unicode organization. @@ -35,7 +35,7 @@ while( ){ if( $code >= 0x80 && $ucs >= 0x0080 ){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_WINX.pl b/src/backend/utils/mb/Unicode/UCS_to_WINX.pl index 60de6d47cc..156507ff55 100644 --- a/src/backend/utils/mb/Unicode/UCS_to_WINX.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_WINX.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_WINX.pl,v 1.5 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_WINX.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> WINX code conversion tables from # map files provided by Unicode organization. @@ -42,7 +42,7 @@ foreach $charset (@charsets) { if( $code >= 0x80){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; @@ -86,7 +86,7 @@ foreach $charset (@charsets) { if($code >= 0x80){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/UCS_to_cyrillic.pl b/src/backend/utils/mb/Unicode/UCS_to_cyrillic.pl index 895ec67d19..f496959448 100644 --- a/src/backend/utils/mb/Unicode/UCS_to_cyrillic.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_cyrillic.pl @@ -2,7 +2,7 @@ # # Copyright (c) 2001-2005, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_cyrillic.pl,v 1.6 2005/01/01 20:44:18 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_cyrillic.pl,v 1.7 2005/03/07 04:30:52 momjian Exp $ # # Generate UTF-8 <--> ISO8859 code conversion tables from # map files provided by Unicode organization. @@ -17,8 +17,8 @@ require "ucs2utf.pl"; %filename = ('KOI8R'=>'koi8-r.txt', 'WIN1251'=>'cp1251.txt', - 'ALT'=>'cp866.txt'); -@charsets = ('KOI8R','ALT','WIN1251'); + 'WIN866'=>'cp866.txt'); +@charsets = ('KOI8R','WIN866','WIN1251'); foreach $charset (@charsets) { # @@ -41,7 +41,7 @@ foreach $charset (@charsets) { if( $code >= 0x80){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; @@ -85,7 +85,7 @@ foreach $charset (@charsets) { if($code >= 0x80){ $utf = &ucs2utf($ucs); if( $array{ $utf } ne "" ){ - printf STDERR "Warning: duplicate unicode: %04x\n",$ucs; + printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; next; } $count++; diff --git a/src/backend/utils/mb/Unicode/utf8_to_tcvn.map b/src/backend/utils/mb/Unicode/utf8_to_win1258.map similarity index 98% rename from src/backend/utils/mb/Unicode/utf8_to_tcvn.map rename to src/backend/utils/mb/Unicode/utf8_to_win1258.map index c7e3b0f258..84cefd91f3 100644 --- a/src/backend/utils/mb/Unicode/utf8_to_tcvn.map +++ b/src/backend/utils/mb/Unicode/utf8_to_win1258.map @@ -1,4 +1,4 @@ -static pg_utf_to_local ULmapTCVN[ 120 ] = { +static pg_utf_to_local ULmapWIN1258[ 120 ] = { {0x0000, 0x0081}, {0xc2a0, 0x00a0}, {0xc2a1, 0x00a1}, diff --git a/src/backend/utils/mb/Unicode/utf8_to_alt.map b/src/backend/utils/mb/Unicode/utf8_to_win866.map similarity index 98% rename from src/backend/utils/mb/Unicode/utf8_to_alt.map rename to src/backend/utils/mb/Unicode/utf8_to_win866.map index 2aba0c5a9b..cac06a82ed 100644 --- a/src/backend/utils/mb/Unicode/utf8_to_alt.map +++ b/src/backend/utils/mb/Unicode/utf8_to_win866.map @@ -1,4 +1,4 @@ -static pg_utf_to_local ULmap_ALT[ 128 ] = { +static pg_utf_to_local ULmap_WIN866[ 128 ] = { {0xc2a0, 0x00ff}, {0xc2a4, 0x00fd}, {0xc2b0, 0x00f8}, diff --git a/src/backend/utils/mb/Unicode/tcvn_to_utf8.map b/src/backend/utils/mb/Unicode/win1258_to_utf8.map similarity index 98% rename from src/backend/utils/mb/Unicode/tcvn_to_utf8.map rename to src/backend/utils/mb/Unicode/win1258_to_utf8.map index 5e680c0f21..0596d8ba4f 100644 --- a/src/backend/utils/mb/Unicode/tcvn_to_utf8.map +++ b/src/backend/utils/mb/Unicode/win1258_to_utf8.map @@ -1,4 +1,4 @@ -static pg_local_to_utf LUmapTCVN[ 128 ] = { +static pg_local_to_utf LUmapWIN1258[ 128 ] = { {0x0080, 0xe282ac}, {0x0081, 0x0000}, {0x0082, 0xe2809a}, diff --git a/src/backend/utils/mb/Unicode/alt_to_utf8.map b/src/backend/utils/mb/Unicode/win866_to_utf8.map similarity index 98% rename from src/backend/utils/mb/Unicode/alt_to_utf8.map rename to src/backend/utils/mb/Unicode/win866_to_utf8.map index 7bc6982224..d2a377a537 100644 --- a/src/backend/utils/mb/Unicode/alt_to_utf8.map +++ b/src/backend/utils/mb/Unicode/win866_to_utf8.map @@ -1,4 +1,4 @@ -static pg_local_to_utf LUmapALT[ 128 ] = { +static pg_local_to_utf LUmapWIN866[ 128 ] = { {0x0080, 0xd090}, {0x0081, 0xd091}, {0x0082, 0xd092}, diff --git a/src/backend/utils/mb/conv.c b/src/backend/utils/mb/conv.c index c84d860e84..8789dcbc3e 100644 --- a/src/backend/utils/mb/conv.c +++ b/src/backend/utils/mb/conv.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.51 2004/12/31 22:01:42 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.52 2005/03/07 04:30:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -303,7 +303,7 @@ mic2latin_with_table( /* * comparison routine for bsearch() - * this routine is intended for UTF-8 -> local code + * this routine is intended for UTF8 -> local code */ static int compare1(const void *p1, const void *p2) @@ -318,7 +318,7 @@ compare1(const void *p1, const void *p2) /* * comparison routine for bsearch() - * this routine is intended for local code -> UTF-8 + * this routine is intended for local code -> UTF8 */ static int compare2(const void *p1, const void *p2) @@ -332,9 +332,9 @@ compare2(const void *p1, const void *p2) } /* - * UTF-8 ---> local code + * UTF8 ---> local code * - * utf: input UTF-8 string. Its length is limited by "len" parameter + * utf: input UTF8 string. Its length is limited by "len" parameter * or a null terminator. * iso: pointer to the output. * map: the conversion map. @@ -373,7 +373,7 @@ UtfToLocal(unsigned char *utf, unsigned char *iso, { ereport(WARNING, (errcode(ERRCODE_UNTRANSLATABLE_CHARACTER), - errmsg("ignoring unconvertible UTF-8 character 0x%04x", + errmsg("ignoring unconvertible UTF8 character 0x%04x", iutf))); continue; } @@ -390,7 +390,7 @@ UtfToLocal(unsigned char *utf, unsigned char *iso, } /* - * local code ---> UTF-8 + * local code ---> UTF8 */ void LocalToUtf(unsigned char *iso, unsigned char *utf, diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile index 1b879dc132..8df4a00891 100644 --- a/src/backend/utils/mb/conversion_procs/Makefile +++ b/src/backend/utils/mb/conversion_procs/Makefile @@ -4,7 +4,7 @@ # Makefile for utils/mb/conversion_procs # # IDENTIFICATION -# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.11 2004/01/21 19:22:19 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.12 2005/03/07 04:30:52 momjian Exp $ # #------------------------------------------------------------------------- @@ -23,7 +23,7 @@ DIRS = \ utf8_and_ascii utf8_and_big5 utf8_and_cyrillic utf8_and_euc_cn \ 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_tcvn utf8_and_uhc utf8_and_win1250 \ + 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 @@ -36,20 +36,20 @@ CONVERSIONS = \ mic_to_iso_8859_5 MULE_INTERNAL ISO-8859-5 mic_to_iso cyrillic_and_mic \ windows_1251_to_mic WIN1251 MULE_INTERNAL win1251_to_mic cyrillic_and_mic \ mic_to_windows_1251 MULE_INTERNAL WIN1251 mic_to_win1251 cyrillic_and_mic \ - windows_866_to_mic ALT MULE_INTERNAL alt_to_mic cyrillic_and_mic \ - mic_to_windows_866 MULE_INTERNAL ALT mic_to_alt cyrillic_and_mic \ + windows_866_to_mic WIN866 MULE_INTERNAL win866_to_mic cyrillic_and_mic \ + mic_to_windows_866 MULE_INTERNAL WIN866 mic_to_win866 cyrillic_and_mic \ koi8_r_to_windows_1251 KOI8R WIN1251 koi8r_to_win1251 cyrillic_and_mic \ windows_1251_to_koi8_r WIN1251 KOI8R win1251_to_koi8r cyrillic_and_mic \ - koi8_r_to_windows_866 KOI8R ALT koi8r_to_alt cyrillic_and_mic \ - windows_866_to_koi8_r ALT KOI8R alt_to_koi8r cyrillic_and_mic \ - windows_866_to_windows_1251 ALT WIN1251 alt_to_win1251 cyrillic_and_mic \ - windows_1251_to_windows_866 WIN1251 ALT win1251_to_alt cyrillic_and_mic \ + koi8_r_to_windows_866 KOI8R WIN866 koi8r_to_win866 cyrillic_and_mic \ + windows_866_to_koi8_r WIN866 KOI8R win866_to_koi8r cyrillic_and_mic \ + windows_866_to_windows_1251 WIN866 WIN1251 win866_to_win1251 cyrillic_and_mic \ + windows_1251_to_windows_866 WIN1251 WIN866 win1251_to_win866 cyrillic_and_mic \ iso_8859_5_to_koi8_r ISO-8859-5 KOI8R iso_to_koi8r cyrillic_and_mic \ koi8_r_to_iso_8859_5 KOI8R ISO-8859-5 koi8r_to_iso cyrillic_and_mic \ iso_8859_5_to_windows_1251 ISO-8859-5 WIN1251 iso_to_win1251 cyrillic_and_mic \ windows_1251_to_iso_8859_5 WIN1251 ISO-8859-5 win1251_to_iso cyrillic_and_mic \ - iso_8859_5_to_windows_866 ISO-8859-5 ALT iso_to_alt cyrillic_and_mic \ - windows_866_to_iso_8859_5 ALT ISO-8859-5 alt_to_iso cyrillic_and_mic \ + iso_8859_5_to_windows_866 ISO-8859-5 WIN866 iso_to_win866 cyrillic_and_mic \ + windows_866_to_iso_8859_5 WIN866 ISO-8859-5 win866_to_iso cyrillic_and_mic \ euc_cn_to_mic EUC_CN MULE_INTERNAL euc_cn_to_mic euc_cn_and_mic \ mic_to_euc_cn MULE_INTERNAL EUC_CN mic_to_euc_cn euc_cn_and_mic \ euc_jp_to_sjis EUC_JP SJIS euc_jp_to_sjis euc_jp_and_sjis \ @@ -78,70 +78,70 @@ CONVERSIONS = \ mic_to_iso_8859_3 MULE_INTERNAL LATIN3 mic_to_latin3 latin_and_mic \ iso_8859_4_to_mic LATIN4 MULE_INTERNAL latin4_to_mic latin_and_mic \ mic_to_iso_8859_4 MULE_INTERNAL LATIN4 mic_to_latin4 latin_and_mic \ - ascii_to_utf_8 SQL_ASCII UNICODE ascii_to_utf8 utf8_and_ascii \ - utf_8_to_ascii UNICODE SQL_ASCII utf8_to_ascii utf8_and_ascii \ - big5_to_utf_8 BIG5 UNICODE big5_to_utf8 utf8_and_big5 \ - utf_8_to_big5 UNICODE BIG5 utf8_to_big5 utf8_and_big5 \ - utf_8_to_koi8_r UNICODE KOI8R utf8_to_koi8r utf8_and_cyrillic \ - koi8_r_to_utf_8 KOI8R UNICODE koi8r_to_utf8 utf8_and_cyrillic \ - utf_8_to_windows_1251 UNICODE WIN1251 utf8_to_win1251 utf8_and_cyrillic \ - windows_1251_to_utf_8 WIN1251 UNICODE win1251_to_utf8 utf8_and_cyrillic \ - utf_8_to_windows_866 UNICODE ALT utf8_to_alt utf8_and_cyrillic \ - windows_866_to_utf_8 ALT UNICODE alt_to_utf8 utf8_and_cyrillic \ - euc_cn_to_utf_8 EUC_CN UNICODE euc_cn_to_utf8 utf8_and_euc_cn \ - utf_8_to_euc_cn UNICODE EUC_CN utf8_to_euc_cn utf8_and_euc_cn \ - euc_jp_to_utf_8 EUC_JP UNICODE euc_jp_to_utf8 utf8_and_euc_jp \ - utf_8_to_euc_jp UNICODE EUC_JP utf8_to_euc_jp utf8_and_euc_jp \ - euc_kr_to_utf_8 EUC_KR UNICODE euc_kr_to_utf8 utf8_and_euc_kr \ - utf_8_to_euc_kr UNICODE EUC_KR utf8_to_euc_kr utf8_and_euc_kr \ - euc_tw_to_utf_8 EUC_TW UNICODE euc_tw_to_utf8 utf8_and_euc_tw \ - utf_8_to_euc_tw UNICODE EUC_TW utf8_to_euc_tw utf8_and_euc_tw \ - gb18030_to_utf_8 GB18030 UNICODE gb18030_to_utf8 utf8_and_gb18030 \ - utf_8_to_gb18030 UNICODE GB18030 utf8_to_gb18030 utf8_and_gb18030 \ - gbk_to_utf_8 GBK UNICODE gbk_to_utf8 utf8_and_gbk \ - utf_8_to_gbk UNICODE GBK utf8_to_gbk utf8_and_gbk \ - utf_8_to_iso_8859_2 UNICODE LATIN2 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_2_to_utf_8 LATIN2 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_3 UNICODE LATIN3 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_3_to_utf_8 LATIN3 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_4 UNICODE LATIN4 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_4_to_utf_8 LATIN4 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_9 UNICODE LATIN5 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_9_to_utf_8 LATIN5 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_10 UNICODE LATIN6 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_10_to_utf_8 LATIN6 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_13 UNICODE LATIN7 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_13_to_utf_8 LATIN7 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_14 UNICODE LATIN8 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_14_to_utf_8 LATIN8 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_15 UNICODE LATIN9 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_15_to_utf_8 LATIN9 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_16 UNICODE LATIN10 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_16_to_utf_8 LATIN10 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_5 UNICODE ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_5_to_utf_8 ISO-8859-5 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_6 UNICODE ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_6_to_utf_8 ISO-8859-6 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_7 UNICODE ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_7_to_utf_8 ISO-8859-7 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - utf_8_to_iso_8859_8 UNICODE ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \ - iso_8859_8_to_utf_8 ISO-8859-8 UNICODE iso8859_to_utf8 utf8_and_iso8859 \ - iso_8859_1_to_utf_8 LATIN1 UNICODE iso8859_1_to_utf8 utf8_and_iso8859_1 \ - utf_8_to_iso_8859_1 UNICODE LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \ - johab_to_utf_8 JOHAB UNICODE johab_to_utf8 utf8_and_johab \ - utf_8_to_johab UNICODE JOHAB utf8_to_johab utf8_and_johab \ - sjis_to_utf_8 SJIS UNICODE sjis_to_utf8 utf8_and_sjis \ - utf_8_to_sjis UNICODE SJIS utf8_to_sjis utf8_and_sjis \ - tcvn_to_utf_8 TCVN UNICODE tcvn_to_utf8 utf8_and_tcvn \ - utf_8_to_tcvn UNICODE TCVN utf8_to_tcvn utf8_and_tcvn \ - uhc_to_utf_8 UHC UNICODE uhc_to_utf8 utf8_and_uhc \ - utf_8_to_uhc UNICODE UHC utf8_to_uhc utf8_and_uhc \ - utf_8_to_windows_1250 UNICODE WIN1250 utf_to_win1250 utf8_and_win1250 \ - windows_1250_to_utf_8 WIN1250 UNICODE win1250_to_utf utf8_and_win1250 \ - utf_8_to_windows_1256 UNICODE WIN1256 utf_to_win1256 utf8_and_win1256 \ - windows_1256_to_utf_8 WIN1256 UNICODE win1256_to_utf utf8_and_win1256 \ - utf_8_to_windows_874 UNICODE WIN874 utf_to_win874 utf8_and_win874 \ - windows_874_to_utf_8 WIN874 UNICODE win874_to_utf utf8_and_win874 + ascii_to_utf8 SQL_ASCII UTF8 ascii_to_utf8 utf8_and_ascii \ + utf8_to_ascii UTF8 SQL_ASCII utf8_to_ascii utf8_and_ascii \ + big5_to_utf8 BIG5 UTF8 big5_to_utf8 utf8_and_big5 \ + utf8_to_big5 UTF8 BIG5 utf8_to_big5 utf8_and_big5 \ + utf8_to_koi8_r UTF8 KOI8R utf8_to_koi8r utf8_and_cyrillic \ + 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_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 \ + utf8_to_euc_cn UTF8 EUC_CN utf8_to_euc_cn utf8_and_euc_cn \ + euc_jp_to_utf8 EUC_JP UTF8 euc_jp_to_utf8 utf8_and_euc_jp \ + utf8_to_euc_jp UTF8 EUC_JP utf8_to_euc_jp utf8_and_euc_jp \ + euc_kr_to_utf8 EUC_KR UTF8 euc_kr_to_utf8 utf8_and_euc_kr \ + utf8_to_euc_kr UTF8 EUC_KR utf8_to_euc_kr utf8_and_euc_kr \ + euc_tw_to_utf8 EUC_TW UTF8 euc_tw_to_utf8 utf8_and_euc_tw \ + utf8_to_euc_tw UTF8 EUC_TW utf8_to_euc_tw utf8_and_euc_tw \ + gb18030_to_utf8 GB18030 UTF8 gb18030_to_utf8 utf8_and_gb18030 \ + utf8_to_gb18030 UTF8 GB18030 utf8_to_gb18030 utf8_and_gb18030 \ + gbk_to_utf8 GBK UTF8 gbk_to_utf8 utf8_and_gbk \ + utf8_to_gbk UTF8 GBK utf8_to_gbk utf8_and_gbk \ + utf8_to_iso_8859_2 UTF8 LATIN2 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_2_to_utf8 LATIN2 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_3 UTF8 LATIN3 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_3_to_utf8 LATIN3 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_4 UTF8 LATIN4 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_4_to_utf8 LATIN4 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_9 UTF8 LATIN5 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_9_to_utf8 LATIN5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_10 UTF8 LATIN6 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_10_to_utf8 LATIN6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_13 UTF8 LATIN7 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_13_to_utf8 LATIN7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_14 UTF8 LATIN8 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_14_to_utf8 LATIN8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_15 UTF8 LATIN9 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_15_to_utf8 LATIN9 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_16 UTF8 LATIN10 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_16_to_utf8 LATIN10 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_5 UTF8 ISO-8859-5 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_5_to_utf8 ISO-8859-5 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_6 UTF8 ISO-8859-6 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_6_to_utf8 ISO-8859-6 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_7 UTF8 ISO-8859-7 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_7_to_utf8 ISO-8859-7 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + utf8_to_iso_8859_8 UTF8 ISO-8859-8 utf8_to_iso8859 utf8_and_iso8859 \ + iso_8859_8_to_utf8 ISO-8859-8 UTF8 iso8859_to_utf8 utf8_and_iso8859 \ + iso_8859_1_to_utf8 LATIN1 UTF8 iso8859_1_to_utf8 utf8_and_iso8859_1 \ + utf8_to_iso_8859_1 UTF8 LATIN1 utf8_to_iso8859_1 utf8_and_iso8859_1 \ + johab_to_utf8 JOHAB UTF8 johab_to_utf8 utf8_and_johab \ + utf8_to_johab UTF8 JOHAB utf8_to_johab utf8_and_johab \ + sjis_to_utf8 SJIS UTF8 sjis_to_utf8 utf8_and_sjis \ + utf8_to_sjis UTF8 SJIS utf8_to_sjis utf8_and_sjis \ + win1258_to_utf8 WIN1258 UTF8 win1258_to_utf8 utf8_and_win1258 \ + 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 diff --git a/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c b/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c index 436218fd7f..6dfe27d221 100644 --- a/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c +++ b/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c,v 1.9 2004/12/31 22:01:48 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c,v 1.10 2005/03/07 04:30:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -23,20 +23,20 @@ PG_FUNCTION_INFO_V1(iso_to_mic); PG_FUNCTION_INFO_V1(mic_to_iso); PG_FUNCTION_INFO_V1(win1251_to_mic); PG_FUNCTION_INFO_V1(mic_to_win1251); -PG_FUNCTION_INFO_V1(alt_to_mic); -PG_FUNCTION_INFO_V1(mic_to_alt); +PG_FUNCTION_INFO_V1(win866_to_mic); +PG_FUNCTION_INFO_V1(mic_to_win866); PG_FUNCTION_INFO_V1(koi8r_to_win1251); PG_FUNCTION_INFO_V1(win1251_to_koi8r); -PG_FUNCTION_INFO_V1(koi8r_to_alt); -PG_FUNCTION_INFO_V1(alt_to_koi8r); -PG_FUNCTION_INFO_V1(alt_to_win1251); -PG_FUNCTION_INFO_V1(win1251_to_alt); +PG_FUNCTION_INFO_V1(koi8r_to_win866); +PG_FUNCTION_INFO_V1(win866_to_koi8r); +PG_FUNCTION_INFO_V1(win866_to_win1251); +PG_FUNCTION_INFO_V1(win1251_to_win866); PG_FUNCTION_INFO_V1(iso_to_koi8r); PG_FUNCTION_INFO_V1(koi8r_to_iso); PG_FUNCTION_INFO_V1(iso_to_win1251); PG_FUNCTION_INFO_V1(win1251_to_iso); -PG_FUNCTION_INFO_V1(iso_to_alt); -PG_FUNCTION_INFO_V1(alt_to_iso); +PG_FUNCTION_INFO_V1(iso_to_win866); +PG_FUNCTION_INFO_V1(win866_to_iso); extern Datum koi8r_to_mic(PG_FUNCTION_ARGS); extern Datum mic_to_koi8r(PG_FUNCTION_ARGS); @@ -44,20 +44,20 @@ extern Datum iso_to_mic(PG_FUNCTION_ARGS); extern Datum mic_to_iso(PG_FUNCTION_ARGS); extern Datum win1251_to_mic(PG_FUNCTION_ARGS); extern Datum mic_to_win1251(PG_FUNCTION_ARGS); -extern Datum alt_to_mic(PG_FUNCTION_ARGS); -extern Datum mic_to_alt(PG_FUNCTION_ARGS); +extern Datum win866_to_mic(PG_FUNCTION_ARGS); +extern Datum mic_to_win866(PG_FUNCTION_ARGS); extern Datum koi8r_to_win1251(PG_FUNCTION_ARGS); extern Datum win1251_to_koi8r(PG_FUNCTION_ARGS); -extern Datum koi8r_to_alt(PG_FUNCTION_ARGS); -extern Datum alt_to_koi8r(PG_FUNCTION_ARGS); -extern Datum alt_to_win1251(PG_FUNCTION_ARGS); -extern Datum win1251_to_alt(PG_FUNCTION_ARGS); +extern Datum koi8r_to_win866(PG_FUNCTION_ARGS); +extern Datum win866_to_koi8r(PG_FUNCTION_ARGS); +extern Datum win866_to_win1251(PG_FUNCTION_ARGS); +extern Datum win1251_to_win866(PG_FUNCTION_ARGS); extern Datum iso_to_koi8r(PG_FUNCTION_ARGS); extern Datum koi8r_to_iso(PG_FUNCTION_ARGS); extern Datum iso_to_win1251(PG_FUNCTION_ARGS); extern Datum win1251_to_iso(PG_FUNCTION_ARGS); -extern Datum iso_to_alt(PG_FUNCTION_ARGS); -extern Datum alt_to_iso(PG_FUNCTION_ARGS); +extern Datum iso_to_win866(PG_FUNCTION_ARGS); +extern Datum win866_to_iso(PG_FUNCTION_ARGS); /* ---------- * conv_proc( @@ -76,8 +76,8 @@ static void iso2mic(unsigned char *l, unsigned char *p, int len); static void mic2iso(unsigned char *mic, unsigned char *p, int len); static void win12512mic(unsigned char *l, unsigned char *p, int len); static void mic2win1251(unsigned char *mic, unsigned char *p, int len); -static void alt2mic(unsigned char *l, unsigned char *p, int len); -static void mic2alt(unsigned char *mic, unsigned char *p, int len); +static void win8662mic(unsigned char *l, unsigned char *p, int len); +static void mic2win866(unsigned char *mic, unsigned char *p, int len); Datum koi8r_to_mic(PG_FUNCTION_ARGS) @@ -176,33 +176,33 @@ mic_to_win1251(PG_FUNCTION_ARGS) } Datum -alt_to_mic(PG_FUNCTION_ARGS) +win866_to_mic(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); - Assert(PG_GETARG_INT32(0) == PG_ALT); + Assert(PG_GETARG_INT32(0) == PG_WIN866); Assert(PG_GETARG_INT32(1) == PG_MULE_INTERNAL); Assert(len >= 0); - alt2mic(src, dest, len); + win8662mic(src, dest, len); PG_RETURN_VOID(); } Datum -mic_to_alt(PG_FUNCTION_ARGS) +mic_to_win866(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); Assert(PG_GETARG_INT32(0) == PG_MULE_INTERNAL); - Assert(PG_GETARG_INT32(1) == PG_ALT); + Assert(PG_GETARG_INT32(1) == PG_WIN866); Assert(len >= 0); - mic2alt(src, dest, len); + mic2win866(src, dest, len); PG_RETURN_VOID(); } @@ -248,7 +248,7 @@ win1251_to_koi8r(PG_FUNCTION_ARGS) } Datum -koi8r_to_alt(PG_FUNCTION_ARGS) +koi8r_to_win866(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); @@ -256,31 +256,31 @@ koi8r_to_alt(PG_FUNCTION_ARGS) unsigned char *buf; Assert(PG_GETARG_INT32(0) == PG_KOI8R); - Assert(PG_GETARG_INT32(1) == PG_ALT); + Assert(PG_GETARG_INT32(1) == PG_WIN866); Assert(len >= 0); buf = palloc(len * ENCODING_GROWTH_RATE); koi8r2mic(src, buf, len); - mic2alt(buf, dest, strlen(buf)); + mic2win866(buf, dest, strlen(buf)); pfree(buf); PG_RETURN_VOID(); } Datum -alt_to_koi8r(PG_FUNCTION_ARGS) +win866_to_koi8r(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); unsigned char *buf; - Assert(PG_GETARG_INT32(0) == PG_ALT); + Assert(PG_GETARG_INT32(0) == PG_WIN866); Assert(PG_GETARG_INT32(1) == PG_KOI8R); Assert(len >= 0); buf = palloc(len * ENCODING_GROWTH_RATE); - alt2mic(src, buf, len); + win8662mic(src, buf, len); mic2koi8r(buf, dest, strlen(buf)); pfree(buf); @@ -288,19 +288,19 @@ alt_to_koi8r(PG_FUNCTION_ARGS) } Datum -alt_to_win1251(PG_FUNCTION_ARGS) +win866_to_win1251(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); unsigned char *buf; - Assert(PG_GETARG_INT32(0) == PG_ALT); + Assert(PG_GETARG_INT32(0) == PG_WIN866); Assert(PG_GETARG_INT32(1) == PG_WIN1251); Assert(len >= 0); buf = palloc(len * ENCODING_GROWTH_RATE); - alt2mic(src, buf, len); + win8662mic(src, buf, len); mic2win1251(buf, dest, strlen(buf)); pfree(buf); @@ -308,7 +308,7 @@ alt_to_win1251(PG_FUNCTION_ARGS) } Datum -win1251_to_alt(PG_FUNCTION_ARGS) +win1251_to_win866(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); @@ -316,12 +316,12 @@ win1251_to_alt(PG_FUNCTION_ARGS) unsigned char *buf; Assert(PG_GETARG_INT32(0) == PG_WIN1251); - Assert(PG_GETARG_INT32(1) == PG_ALT); + Assert(PG_GETARG_INT32(1) == PG_WIN866); Assert(len >= 0); buf = palloc(len * ENCODING_GROWTH_RATE); win12512mic(src, buf, len); - mic2alt(buf, dest, strlen(buf)); + mic2win866(buf, dest, strlen(buf)); pfree(buf); PG_RETURN_VOID(); @@ -408,7 +408,7 @@ win1251_to_iso(PG_FUNCTION_ARGS) } Datum -iso_to_alt(PG_FUNCTION_ARGS) +iso_to_win866(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); @@ -416,32 +416,32 @@ iso_to_alt(PG_FUNCTION_ARGS) unsigned char *buf; Assert(PG_GETARG_INT32(0) == PG_ISO_8859_5); - Assert(PG_GETARG_INT32(1) == PG_ALT); + Assert(PG_GETARG_INT32(1) == PG_WIN866); Assert(len >= 0); buf = palloc(len * ENCODING_GROWTH_RATE); iso2mic(src, buf, len); - mic2alt(buf, dest, strlen(buf)); + mic2win866(buf, dest, strlen(buf)); pfree(buf); PG_RETURN_VOID(); } Datum -alt_to_iso(PG_FUNCTION_ARGS) +win866_to_iso(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); unsigned char *buf; - Assert(PG_GETARG_INT32(0) == PG_ALT); + Assert(PG_GETARG_INT32(0) == PG_WIN866); Assert(PG_GETARG_INT32(1) == PG_ISO_8859_5); Assert(len >= 0); buf = palloc(len * ENCODING_GROWTH_RATE); - alt2mic(src, buf, len); - mic2alt(buf, dest, strlen(buf)); + win8662mic(src, buf, len); + mic2win866(buf, dest, strlen(buf)); pfree(buf); PG_RETURN_VOID(); @@ -576,11 +576,11 @@ mic2win1251(unsigned char *mic, unsigned char *p, int len) mic2latin_with_table(mic, p, len, LC_KOI8_R, koi2win); } -/* alt2mic: CP866 to Mule internal code */ +/* win8662mic: CP866 to Mule internal code */ static void -alt2mic(unsigned char *l, unsigned char *p, int len) +win8662mic(unsigned char *l, unsigned char *p, int len) { - static unsigned char alt2koi[] = { + static unsigned char win8662koi[] = { 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, @@ -599,14 +599,14 @@ alt2mic(unsigned char *l, unsigned char *p, int len) 0xb6, 0xa6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - latin2mic_with_table(l, p, len, LC_KOI8_R, alt2koi); + latin2mic_with_table(l, p, len, LC_KOI8_R, win8662koi); } -/* mic2alt: Mule internal code to CP866 */ +/* mic2win866: Mule internal code to CP866 */ static void -mic2alt(unsigned char *mic, unsigned char *p, int len) +mic2win866(unsigned char *mic, unsigned char *p, int len) { - static unsigned char koi2alt[] = { + static unsigned char koi2win866[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -625,5 +625,5 @@ mic2alt(unsigned char *mic, unsigned char *p, int len) 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a }; - mic2latin_with_table(mic, p, len, LC_KOI8_R, koi2alt); + mic2latin_with_table(mic, p, len, LC_KOI8_R, koi2win866); } diff --git a/src/backend/utils/mb/conversion_procs/regress_prolog b/src/backend/utils/mb/conversion_procs/regress_prolog index 5136019d62..f5c71790cf 100644 --- a/src/backend/utils/mb/conversion_procs/regress_prolog +++ b/src/backend/utils/mb/conversion_procs/regress_prolog @@ -3,19 +3,19 @@ -- CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER; SET SESSION AUTHORIZATION conversion_test_user; -CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- cannot make same name conversion in same schema -- -CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- create default conversion with qualified name -- -CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- cannot make default conversion with same shcema/for_encoding/to_encoding -- -CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- drop user defined conversion -- diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c b/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c index 93ce77377b..fcec54316e 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * ASCII <--> UTF-8 + * ASCII <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c,v 1.9 2004/12/31 22:02:11 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c,v 1.10 2005/03/07 04:30:52 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c b/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c index 31b5b5f3e2..583bf6d381 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * BIG5 <--> UTF-8 + * BIG5 <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c,v 1.9 2004/12/31 22:02:13 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c index 81dc25f361..5022f71f33 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c,v 1.9 2004/12/31 22:02:14 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -18,22 +18,22 @@ #include "../../Unicode/koi8r_to_utf8.map" #include "../../Unicode/utf8_to_win1251.map" #include "../../Unicode/win1251_to_utf8.map" -#include "../../Unicode/utf8_to_alt.map" -#include "../../Unicode/alt_to_utf8.map" +#include "../../Unicode/utf8_to_win866.map" +#include "../../Unicode/win866_to_utf8.map" PG_FUNCTION_INFO_V1(utf8_to_koi8r); PG_FUNCTION_INFO_V1(koi8r_to_utf8); PG_FUNCTION_INFO_V1(utf8_to_win1251); PG_FUNCTION_INFO_V1(win1251_to_utf8); -PG_FUNCTION_INFO_V1(utf8_to_alt); -PG_FUNCTION_INFO_V1(alt_to_utf8); +PG_FUNCTION_INFO_V1(utf8_to_win866); +PG_FUNCTION_INFO_V1(win866_to_utf8); extern Datum utf8_to_koi8r(PG_FUNCTION_ARGS); extern Datum koi8r_to_utf8(PG_FUNCTION_ARGS); extern Datum utf8_to_win1251(PG_FUNCTION_ARGS); extern Datum win1251_to_utf8(PG_FUNCTION_ARGS); -extern Datum utf8_to_alt(PG_FUNCTION_ARGS); -extern Datum alt_to_utf8(PG_FUNCTION_ARGS); +extern Datum utf8_to_win866(PG_FUNCTION_ARGS); +extern Datum win866_to_utf8(PG_FUNCTION_ARGS); /* ---------- * conv_proc( @@ -115,35 +115,35 @@ win1251_to_utf8(PG_FUNCTION_ARGS) } Datum -utf8_to_alt(PG_FUNCTION_ARGS) +utf8_to_win866(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); Assert(PG_GETARG_INT32(0) == PG_UTF8); - Assert(PG_GETARG_INT32(1) == PG_ALT); + Assert(PG_GETARG_INT32(1) == PG_WIN866); Assert(len >= 0); - UtfToLocal(src, dest, ULmap_ALT, - sizeof(ULmap_ALT) / sizeof(pg_utf_to_local), len); + UtfToLocal(src, dest, ULmap_WIN866, + sizeof(ULmap_WIN866) / sizeof(pg_utf_to_local), len); PG_RETURN_VOID(); } Datum -alt_to_utf8(PG_FUNCTION_ARGS) +win866_to_utf8(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); - Assert(PG_GETARG_INT32(0) == PG_ALT); + Assert(PG_GETARG_INT32(0) == PG_WIN866); Assert(PG_GETARG_INT32(1) == PG_UTF8); Assert(len >= 0); - LocalToUtf(src, dest, LUmapALT, - sizeof(LUmapALT) / sizeof(pg_local_to_utf), PG_ALT, len); + LocalToUtf(src, dest, LUmapWIN866, + sizeof(LUmapWIN866) / sizeof(pg_local_to_utf), PG_WIN866, len); PG_RETURN_VOID(); } diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c index 59dfe9d0a7..1de2ab389c 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * EUC_CN <--> UTF-8 + * EUC_CN <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c,v 1.9 2004/12/31 22:02:16 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c index d438148d31..3c4417df6a 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * EUC_JP <--> UTF-8 + * EUC_JP <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c,v 1.9 2004/12/31 22:02:17 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c index 0f8668546f..47902d95ac 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * EUC_KR <--> UTF-8 + * EUC_KR <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c,v 1.9 2004/12/31 22:02:19 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c index 8ceb89140c..4ea1849a40 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * EUC_TW <--> UTF-8 + * EUC_TW <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c,v 1.9 2004/12/31 22:02:20 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c b/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c index ae06726158..75e3e7c797 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * GB18030 <--> UTF-8 + * GB18030 <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c,v 1.9 2004/12/31 22:02:23 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c b/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c index 04524c8497..ef42c0586f 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * GBK <--> UTF-8 + * GBK <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c,v 1.9 2004/12/31 22:02:26 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c,v 1.10 2005/03/07 04:30:53 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c index 1bb101d4da..ab830129e1 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * ISO 8859 2-16 <--> UTF-8 + * ISO 8859 2-16 <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.11 2004/12/31 22:02:27 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.12 2005/03/07 04:30:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -61,8 +61,8 @@ extern Datum utf8_to_iso8859(PG_FUNCTION_ARGS); typedef struct { pg_enc encoding; - pg_local_to_utf *map1; /* to UTF-8 map name */ - pg_utf_to_local *map2; /* from UTF-8 map name */ + pg_local_to_utf *map1; /* to UTF8 map name */ + pg_utf_to_local *map2; /* from UTF8 map name */ int size1; /* size of map1 */ int size2; /* size of map2 */ } pg_conv_map; @@ -74,7 +74,7 @@ static pg_conv_map maps[] = { {PG_EUC_KR}, /* EUC for Korean */ {PG_EUC_TW}, /* EUC for Taiwan */ {PG_JOHAB}, /* EUC for Korean JOHAB */ - {PG_UTF8}, /* Unicode UTF-8 */ + {PG_UTF8}, /* Unicode UTF8 */ {PG_MULE_INTERNAL}, /* Mule internal code */ {PG_LATIN1}, /* ISO-8859-1 Latin 1 */ {PG_LATIN2, LUmapISO8859_2, ULmapISO8859_2, @@ -105,11 +105,11 @@ static pg_conv_map maps[] = { sizeof(LUmapISO8859_16) / sizeof(pg_local_to_utf), sizeof(ULmapISO8859_16) / sizeof(pg_utf_to_local)}, /* ISO-8859-16 Latin 10 */ {PG_WIN1256}, /* windows-1256 */ - {PG_TCVN}, /* TCVN (Windows-1258) */ + {PG_WIN1258}, /* Windows-1258 */ {PG_WIN874}, /* windows-874 */ {PG_KOI8R}, /* KOI8-R */ {PG_WIN1251}, /* windows-1251 (was: WIN) */ - {PG_ALT}, /* (MS-DOS CP866) */ + {PG_WIN866}, /* (MS-DOS CP866) */ {PG_ISO_8859_5, LUmapISO8859_5, ULmapISO8859_5, sizeof(LUmapISO8859_5) / sizeof(pg_local_to_utf), sizeof(ULmapISO8859_5) / sizeof(pg_utf_to_local)}, /* ISO-8859-5 */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c index 8b5812eead..686ce23085 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * ISO8859_1 <--> UTF-8 + * ISO8859_1 <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.10 2004/12/31 22:02:29 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.11 2005/03/07 04:30:54 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -84,7 +84,7 @@ utf8_to_iso8859_1(PG_FUNCTION_ARGS) len -= 2; } else if ((c & 0xe0) == 0xe0) - elog(ERROR, "could not convert UTF-8 character 0x%04x to ISO8859-1", + elog(ERROR, "could not convert UTF8 character 0x%04x to ISO8859-1", c); else { diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c b/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c index 3083d397ce..90229c5bc9 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * JOHAB <--> UTF-8 + * JOHAB <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c,v 1.9 2004/12/31 22:02:31 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c,v 1.10 2005/03/07 04:30:54 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c b/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c index 3d3f805f1f..98ac4a60cd 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * SJIS <--> UTF-8 + * SJIS <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c,v 1.9 2004/12/31 22:02:33 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c,v 1.10 2005/03/07 04:30:54 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c b/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c index c995ebc59a..737c85afcf 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * UHC <--> UTF-8 + * UHC <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c,v 1.9 2004/12/31 22:02:36 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c,v 1.10 2005/03/07 04:30:54 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c b/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c index 3b260a0e64..bdbeaa741d 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * WIN1250 and UTF-8 + * WIN1250 and UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c,v 1.9 2004/12/31 22:02:38 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c,v 1.10 2005/03/07 04:30:54 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c b/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c index 1001e19e75..6af8e6fcff 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * WIN1256 and UTF-8 + * WIN1256 and UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c,v 1.9 2004/12/31 22:02:39 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c,v 1.10 2005/03/07 04:30:54 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Makefile b/src/backend/utils/mb/conversion_procs/utf8_and_win1258/Makefile similarity index 81% rename from src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Makefile rename to src/backend/utils/mb/conversion_procs/utf8_and_win1258/Makefile index 5a749af1e9..6f7604c68d 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Makefile +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win1258/Makefile @@ -1,12 +1,12 @@ #------------------------------------------------------------------------- # -# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Makefile,v 1.3 2003/11/29 22:40:38 pgsql Exp $ +# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1258/Makefile,v 1.1 2005/03/07 04:30:55 momjian Exp $ # #------------------------------------------------------------------------- subdir = src/backend/utils/mb/conversion_procs/utf8_and_tcvn top_builddir = ../../../../../.. include $(top_builddir)/src/Makefile.global -NAME := utf8_and_tcvn +NAME := utf8_and_win1258 include $(srcdir)/../proc.mk diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c b/src/backend/utils/mb/conversion_procs/utf8_and_win1258/utf8_and_win1258.c similarity index 62% rename from src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c rename to src/backend/utils/mb/conversion_procs/utf8_and_win1258/utf8_and_win1258.c index 4894d3fee8..d1dee0951e 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win1258/utf8_and_win1258.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * TCVN <--> UTF-8 + * WIN1258 <--> UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c,v 1.9 2004/12/31 22:02:35 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1258/utf8_and_win1258.c,v 1.1 2005/03/07 04:30:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -14,14 +14,14 @@ #include "postgres.h" #include "fmgr.h" #include "mb/pg_wchar.h" -#include "../../Unicode/tcvn_to_utf8.map" -#include "../../Unicode/utf8_to_tcvn.map" +#include "../../Unicode/win1258_to_utf8.map" +#include "../../Unicode/utf8_to_win1258.map" -PG_FUNCTION_INFO_V1(tcvn_to_utf8); -PG_FUNCTION_INFO_V1(utf8_to_tcvn); +PG_FUNCTION_INFO_V1(win1258_to_utf8); +PG_FUNCTION_INFO_V1(utf8_to_win1258); -extern Datum tcvn_to_utf8(PG_FUNCTION_ARGS); -extern Datum utf8_to_tcvn(PG_FUNCTION_ARGS); +extern Datum win1258_to_utf8(PG_FUNCTION_ARGS); +extern Datum utf8_to_win1258(PG_FUNCTION_ARGS); /* ---------- * conv_proc( @@ -34,35 +34,35 @@ extern Datum utf8_to_tcvn(PG_FUNCTION_ARGS); * ---------- */ Datum -tcvn_to_utf8(PG_FUNCTION_ARGS) +win1258_to_utf8(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); - Assert(PG_GETARG_INT32(0) == PG_TCVN); + Assert(PG_GETARG_INT32(0) == PG_WIN1258); Assert(PG_GETARG_INT32(1) == PG_UTF8); Assert(len >= 0); - LocalToUtf(src, dest, LUmapTCVN, - sizeof(LUmapTCVN) / sizeof(pg_local_to_utf), PG_TCVN, len); + LocalToUtf(src, dest, LUmapWIN1258, + sizeof(LUmapWIN1258) / sizeof(pg_local_to_utf), PG_WIN1258, len); PG_RETURN_VOID(); } Datum -utf8_to_tcvn(PG_FUNCTION_ARGS) +utf8_to_win1258(PG_FUNCTION_ARGS) { unsigned char *src = PG_GETARG_CSTRING(2); unsigned char *dest = PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); Assert(PG_GETARG_INT32(0) == PG_UTF8); - Assert(PG_GETARG_INT32(1) == PG_TCVN); + Assert(PG_GETARG_INT32(1) == PG_WIN1258); Assert(len >= 0); - UtfToLocal(src, dest, ULmapTCVN, - sizeof(ULmapTCVN) / sizeof(pg_utf_to_local), len); + UtfToLocal(src, dest, ULmapWIN1258, + sizeof(ULmapWIN1258) / sizeof(pg_utf_to_local), len); PG_RETURN_VOID(); } diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c b/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c index c37c5c495b..449a5c3323 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * - * WIN874 and UTF-8 + * WIN874 and UTF8 * * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c,v 1.9 2004/12/31 22:02:41 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c,v 1.10 2005/03/07 04:30:55 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/utils/mb/encnames.c b/src/backend/utils/mb/encnames.c index 0c28438630..14db569553 100644 --- a/src/backend/utils/mb/encnames.c +++ b/src/backend/utils/mb/encnames.c @@ -2,7 +2,7 @@ * Encoding names and routines for work with it. All * in this file is shared bedween FE and BE. * - * $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.22 2004/12/04 18:19:31 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.23 2005/03/07 04:30:52 momjian Exp $ */ #ifdef FRONTEND #include "postgres_fe.h" @@ -27,7 +27,7 @@ * isalnum() chars only. It means ISO-8859-1, iso_8859-1 and Iso8859_1 * are always converted to 'iso88591'. All must be lower case. * - * The table doesn't contain 'cs' aliases (like csISOLatin1). It's needful? + * The table doesn't contain 'cs' aliases (like csISOLatin1). It's needed? * * Karel Zak, Aug 2001 * ---------- @@ -35,10 +35,10 @@ pg_encname pg_encname_tbl[] = { { - "abc", PG_TCVN - }, /* alias for TCVN */ + "abc", PG_WIN1258 + }, /* alias for WIN1258 */ { - "alt", PG_ALT + "alt", PG_WIN866 }, /* IBM866 */ { "big5", PG_BIG5 @@ -166,23 +166,26 @@ pg_encname pg_encname_tbl[] = "sqlascii", PG_SQL_ASCII }, { - "tcvn", PG_TCVN - }, /* TCVN; Vietnamese TCVN-5712 */ + "tcvn", PG_WIN1258 + }, /* alias for WIN1258 */ { - "tcvn5712", PG_TCVN - }, /* alias for TCVN */ + "tcvn5712", PG_WIN1258 + }, /* alias for WIN1258 */ { "uhc", PG_UHC }, /* UHC; Korean Windows CodePage 949 */ { "unicode", PG_UTF8 - }, /* alias for UTF-8 */ + }, /* alias for UTF8 */ + { + "utf-8", PG_UTF8 + }, /* UTF8; RFC2279 */ { "utf8", PG_UTF8 - }, /* UTF-8; RFC2279 */ + }, /* alias for UTF8 */ { - "vscii", PG_TCVN - }, /* alias for TCVN */ + "vscii", PG_WIN1258 + }, /* alias for WIN1258 */ { "win", PG_WIN1251 }, /* _dirty_ alias for windows-1251 @@ -197,8 +200,11 @@ pg_encname pg_encname_tbl[] = "win1256", PG_WIN1256 }, /* alias for Windows-1256 */ { - "win1258", PG_TCVN + "win1258", PG_WIN1258 }, /* alias for Windows-1258 */ + { + "win866", PG_WIN866 + }, /* IBM866 */ { "win874", PG_WIN874 }, /* alias for Windows-874 */ @@ -224,8 +230,11 @@ pg_encname pg_encname_tbl[] = "windows1256", PG_WIN1256 }, /* Windows-1256; Microsoft */ { - "windows1258", PG_TCVN + "windows1258", PG_WIN1258 }, /* Windows-1258; Microsoft */ + { + "windows866", PG_WIN866 + }, /* IBM866 */ { "windows874", PG_WIN874 }, /* Windows-874; Microsoft */ @@ -275,7 +284,7 @@ pg_enc2name pg_enc2name_tbl[] = "JOHAB", PG_JOHAB }, { - "UNICODE", PG_UTF8 + "UTF8", PG_UTF8 }, { "MULE_INTERNAL", PG_MULE_INTERNAL @@ -314,7 +323,10 @@ pg_enc2name pg_enc2name_tbl[] = "WIN1256", PG_WIN1256 }, { - "TCVN", PG_TCVN + "WIN1258", PG_WIN1258 + }, + { + "WIN866", PG_WIN866 }, { "WIN874", PG_WIN874 @@ -323,10 +335,7 @@ pg_enc2name pg_enc2name_tbl[] = "KOI8", PG_KOI8R }, { - "WIN", PG_WIN1251 - }, - { - "ALT", PG_ALT + "WIN1251", PG_WIN1251 }, { "ISO_8859_5", PG_ISO_8859_5 diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c index 9718e7e73e..541f9c2a5d 100644 --- a/src/backend/utils/mb/mbutils.c +++ b/src/backend/utils/mb/mbutils.c @@ -4,7 +4,7 @@ * (currently mule internal code (mic) is used) * Tatsuo Ishii * - * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.48 2004/10/13 01:25:12 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.49 2005/03/07 04:30:52 momjian Exp $ */ #include "postgres.h" @@ -222,7 +222,7 @@ pg_get_client_encoding_name(void) * * XXX We assume that storage for converted result is 4-to-1 growth in * the worst case. The rate for currently supported encoding pares are within 3 - * (SJIS JIS X0201 half width kanna -> UTF-8 is the worst case). + * (SJIS JIS X0201 half width kanna -> UTF8 is the worst case). * So "4" should be enough for the moment. */ unsigned char * diff --git a/src/backend/utils/mb/wchar.c b/src/backend/utils/mb/wchar.c index 5a52d34de2..a74cc3ec33 100644 --- a/src/backend/utils/mb/wchar.c +++ b/src/backend/utils/mb/wchar.c @@ -1,7 +1,7 @@ /* * conversion functions between pg_wchar and multibyte streams. * Tatsuo Ishii - * $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.40 2004/12/03 01:20:20 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.41 2005/03/07 04:30:52 momjian Exp $ * * WIN1250 client encoding updated by Pavel Behal * @@ -344,7 +344,7 @@ pg_johab_dsplen(const unsigned char *s) } /* - * convert UTF-8 string to pg_wchar (UCS-2) + * convert UTF8 string to pg_wchar (UCS-2) * caller should allocate enough space for "to" * len: length of from. * "from" not necessarily null terminated. @@ -395,7 +395,7 @@ pg_utf2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) } /* - * returns the byte length of a UTF-8 word pointed to by s + * returns the byte length of a UTF8 word pointed to by s */ int pg_utf_mblen(const unsigned char *s) @@ -721,8 +721,8 @@ pg_wchar_tbl pg_wchar_table[] = { {pg_euckr2wchar_with_len, pg_euckr_mblen, pg_euckr_dsplen, 3}, /* 3; PG_EUC_KR */ {pg_euctw2wchar_with_len, pg_euctw_mblen, pg_euctw_dsplen, 3}, /* 4; PG_EUC_TW */ {pg_johab2wchar_with_len, pg_johab_mblen, pg_johab_dsplen, 3}, /* 5; PG_JOHAB */ - {pg_utf2wchar_with_len, pg_utf_mblen, pg_utf_dsplen, 3}, /* 6; PG_UNICODE */ - {pg_mule2wchar_with_len, pg_mule_mblen, pg_mule_dsplen, 3}, /* 7; PG_MULE_INTERNAL */ + {pg_utf2wchar_with_len, pg_utf_mblen, pg_utf_dsplen, 3}, /* 6; PG_UTF8 */ + {pg_mule2wchar_with_len, pg_mule_mblen, pg_mule_dsplen, 3}, /* 7; PG_MULE_INTERNAL */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 8; PG_LATIN1 */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 9; PG_LATIN2 */ {pg_latin12wchar_with_len, pg_latin1_mblen, pg_latin1_dsplen, 1}, /* 10; PG_LATIN3 */ @@ -822,7 +822,7 @@ pg_verifymbstr(const unsigned char *mbstr, int len, bool noError) while (len > 0 && *mbstr) { - /* special UTF-8 check */ + /* special UTF8 check */ if (encoding == PG_UTF8 && (*mbstr & 0xf8) == 0xf0) { if (noError) diff --git a/src/backend/utils/mb/win.c b/src/backend/utils/mb/win.c deleted file mode 100644 index 968fcf2e4e..0000000000 --- a/src/backend/utils/mb/win.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * make KOI8->CP1251(win-1251) and CP1251(win-1251)->KOI8 translation table - * from koi-win.tab. - * - * Tatsuo Ishii - * - * $PostgreSQL: pgsql/src/backend/utils/mb/win.c,v 1.4 2003/11/29 22:39:59 pgsql Exp $ - */ - -#include - - -main() -{ - int i; - char koitab[128], - wintab[128]; - char buf[4096]; - int koi, - win; - - for (i = 0; i < 128; i++) - koitab[i] = wintab[i] = 0; - - while (fgets(buf, sizeof(buf), stdin) != NULL) - { - if (*buf == '#') - continue; - sscanf(buf, "%d %d", &koi, &win); - if (koi < 128 || koi > 255 || win < 128 || win > 255) - { - fprintf(stderr, "invalid value %d\n", koi); - exit(1); - } - koitab[koi - 128] = win; - wintab[win - 128] = koi; - } - - i = 0; - printf("static char koi2win[] = {\n"); - while (i < 128) - { - int j = 0; - - while (j < 8) - { - printf("0x%02x", koitab[i++]); - j++; - if (i >= 128) - break; - printf(", "); - } - printf("\n"); - } - printf("};\n"); - - i = 0; - printf("static char win2koi[] = {\n"); - while (i < 128) - { - int j = 0; - - while (j < 8) - { - printf("0x%02x", wintab[i++]); - j++; - if (i >= 128) - break; - printf(", "); - } - printf("\n"); - } - printf("};\n"); -} diff --git a/src/backend/utils/mb/alt.c b/src/backend/utils/mb/win866.c similarity index 91% rename from src/backend/utils/mb/alt.c rename to src/backend/utils/mb/win866.c index 232529c336..b525aab123 100644 --- a/src/backend/utils/mb/alt.c +++ b/src/backend/utils/mb/win866.c @@ -4,7 +4,7 @@ * * Tatsuo Ishii * - * $PostgreSQL: pgsql/src/backend/utils/mb/alt.c,v 1.4 2003/11/29 22:39:59 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/win866.c,v 1.1 2005/03/07 04:30:52 momjian Exp $ */ #include diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index e6cfc05d20..d2ad949331 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -39,7 +39,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * Portions taken from FreeBSD. * - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.76 2005/02/26 18:43:34 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.77 2005/03/07 04:30:55 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -723,7 +723,7 @@ struct encoding_match encoding_match_list[] = { {PG_JOHAB, "???"}, #endif - {PG_UTF8, "UTF-8"}, + {PG_UTF8, "UTF8"}, {PG_UTF8, "utf8"}, {PG_LATIN1, "ISO-8859-1"}, @@ -767,13 +767,13 @@ struct encoding_match encoding_match_list[] = { {PG_LATIN10, "iso885916"}, {PG_WIN1256, "CP1256"}, - {PG_TCVN, "CP1258"}, + {PG_WIN1258, "CP1258"}, #ifdef NOT_VERIFIED {PG_WIN874, "???"}, #endif {PG_KOI8R, "KOI8-R"}, {PG_WIN1251, "CP1251"}, - {PG_ALT, "CP866"}, + {PG_WIN866, "CP866"}, {PG_ISO_8859_5, "ISO-8859-5"}, {PG_ISO_8859_5, "ISO8859-5"}, diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h index 568679bf44..d13eda5e76 100644 --- a/src/include/mb/pg_wchar.h +++ b/src/include/mb/pg_wchar.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.56 2004/12/04 18:19:33 momjian Exp $ */ +/* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.57 2005/03/07 04:30:55 momjian Exp $ */ #ifndef PG_WCHAR_H #define PG_WCHAR_H @@ -155,7 +155,7 @@ typedef enum pg_enc PG_EUC_KR, /* EUC for Korean */ PG_EUC_TW, /* EUC for Taiwan */ PG_JOHAB, /* EUC for Korean JOHAB */ - PG_UTF8, /* Unicode UTF-8 */ + PG_UTF8, /* Unicode UTF8 */ PG_MULE_INTERNAL, /* Mule internal code */ PG_LATIN1, /* ISO-8859-1 Latin 1 */ PG_LATIN2, /* ISO-8859-2 Latin 2 */ @@ -168,11 +168,11 @@ typedef enum pg_enc PG_LATIN9, /* ISO-8859-15 Latin9 */ PG_LATIN10, /* ISO-8859-16 Latin10 */ PG_WIN1256, /* windows-1256 */ - PG_TCVN, /* TCVN (Windows-1258) */ + PG_WIN1258, /* Windows-1258 */ + PG_WIN866, /* (MS-DOS CP866) */ PG_WIN874, /* windows-874 */ PG_KOI8R, /* KOI8-R */ PG_WIN1251, /* windows-1251 (was: WIN) */ - PG_ALT, /* (MS-DOS CP866) */ PG_ISO_8859_5, /* ISO-8859-5 */ PG_ISO_8859_6, /* ISO-8859-6 */ PG_ISO_8859_7, /* ISO-8859-7 */ @@ -263,21 +263,21 @@ typedef struct extern pg_wchar_tbl pg_wchar_table[]; /* - * UTF-8 to local code conversion map + * UTF8 to local code conversion map */ typedef struct { - unsigned int utf; /* UTF-8 */ + unsigned int utf; /* UTF8 */ unsigned int code; /* local code */ } pg_utf_to_local; /* - * local code to UTF-8 conversion map + * local code to UTF8 conversion map */ typedef struct { unsigned int code; /* local code */ - unsigned int utf; /* UTF-8 */ + unsigned int utf; /* UTF8 */ } pg_local_to_utf; extern int pg_mb2wchar(const unsigned char *from, pg_wchar *to); diff --git a/src/test/mb/mbregress.sh b/src/test/mb/mbregress.sh index 73f0302255..9bd8b9cbfb 100644 --- a/src/test/mb/mbregress.sh +++ b/src/test/mb/mbregress.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $PostgreSQL: pgsql/src/test/mb/mbregress.sh,v 1.7 2003/11/29 19:52:14 pgsql Exp $ +# $PostgreSQL: pgsql/src/test/mb/mbregress.sh,v 1.8 2005/03/07 04:30:55 momjian Exp $ if echo '\c' | grep -s c >/dev/null 2>&1 then @@ -15,10 +15,10 @@ if [ ! -d results ];then fi dropdb unitest -createdb -E UNICODE unitest +createdb -E UTF8 unitest PSQL="psql -n -e -q" -tests="euc_jp sjis euc_kr euc_cn euc_tw big5 unicode mule_internal" +tests="euc_jp sjis euc_kr euc_cn euc_tw big5 utf8 mule_internal" unset PGCLIENTENCODING for i in $tests do diff --git a/src/test/regress/expected/conversion.out b/src/test/regress/expected/conversion.out index c0e85b85a1..ea2984a227 100644 --- a/src/test/regress/expected/conversion.out +++ b/src/test/regress/expected/conversion.out @@ -3,21 +3,21 @@ -- CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER; SET SESSION AUTHORIZATION conversion_test_user; -CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- cannot make same name conversion in same schema -- -CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; ERROR: conversion "myconv" already exists -- -- create default conversion with qualified name -- -CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- cannot make default conversion with same shcema/for_encoding/to_encoding -- -CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; -ERROR: default conversion for LATIN1 to UNICODE already exists +CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; +ERROR: default conversion for LATIN1 to UTF8 already exists -- test comments COMMENT ON CONVERSION myconv_bad IS 'foo'; ERROR: conversion "myconv_bad" does not exist @@ -134,27 +134,27 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'WIN1251'); foo (1 row) --- ALT --> MULE_INTERNAL +-- WIN866 --> MULE_INTERNAL SELECT CONVERT('foo' USING windows_866_to_mic); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ALT', 'MULE_INTERNAL'); +SELECT CONVERT('foo', 'WIN866', 'MULE_INTERNAL'); convert --------- foo (1 row) --- MULE_INTERNAL --> ALT +-- MULE_INTERNAL --> WIN866 SELECT CONVERT('foo' USING mic_to_windows_866); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'MULE_INTERNAL', 'ALT'); +SELECT CONVERT('foo', 'MULE_INTERNAL', 'WIN866'); convert --------- foo @@ -186,53 +186,53 @@ SELECT CONVERT('foo', 'WIN1251', 'KOI8R'); foo (1 row) --- KOI8R --> ALT +-- KOI8R --> WIN866 SELECT CONVERT('foo' USING koi8_r_to_windows_866); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'KOI8R', 'ALT'); +SELECT CONVERT('foo', 'KOI8R', 'WIN866'); convert --------- foo (1 row) --- ALT --> KOI8R +-- WIN866 --> KOI8R SELECT CONVERT('foo' USING windows_866_to_koi8_r); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ALT', 'KOI8R'); +SELECT CONVERT('foo', 'WIN866', 'KOI8R'); convert --------- foo (1 row) --- ALT --> WIN1251 +-- WIN866 --> WIN1251 SELECT CONVERT('foo' USING windows_866_to_windows_1251); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ALT', 'WIN1251'); +SELECT CONVERT('foo', 'WIN866', 'WIN1251'); convert --------- foo (1 row) --- WIN1251 --> ALT +-- WIN1251 --> WIN866 SELECT CONVERT('foo' USING windows_1251_to_windows_866); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'WIN1251', 'ALT'); +SELECT CONVERT('foo', 'WIN1251', 'WIN866'); convert --------- foo @@ -290,27 +290,27 @@ SELECT CONVERT('foo', 'WIN1251', 'ISO-8859-5'); foo (1 row) --- ISO-8859-5 --> ALT +-- ISO-8859-5 --> WIN866 SELECT CONVERT('foo' USING iso_8859_5_to_windows_866); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ISO-8859-5', 'ALT'); +SELECT CONVERT('foo', 'ISO-8859-5', 'WIN866'); convert --------- foo (1 row) --- ALT --> ISO-8859-5 +-- WIN866 --> ISO-8859-5 SELECT CONVERT('foo' USING windows_866_to_iso_8859_5); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ALT', 'ISO-8859-5'); +SELECT CONVERT('foo', 'WIN866', 'ISO-8859-5'); convert --------- foo @@ -680,833 +680,833 @@ SELECT CONVERT('foo', 'MULE_INTERNAL', 'LATIN4'); foo (1 row) --- SQL_ASCII --> UNICODE -SELECT CONVERT('foo' USING ascii_to_utf_8); +-- SQL_ASCII --> UTF8 +SELECT CONVERT('foo' USING ascii_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'SQL_ASCII', 'UNICODE'); +SELECT CONVERT('foo', 'SQL_ASCII', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> SQL_ASCII -SELECT CONVERT('foo' USING utf_8_to_ascii); +-- UTF8 --> SQL_ASCII +SELECT CONVERT('foo' USING utf8_to_ascii); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'SQL_ASCII'); +SELECT CONVERT('foo', 'UTF8', 'SQL_ASCII'); convert --------- foo (1 row) --- BIG5 --> UNICODE -SELECT CONVERT('foo' USING big5_to_utf_8); +-- BIG5 --> UTF8 +SELECT CONVERT('foo' USING big5_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'BIG5', 'UNICODE'); +SELECT CONVERT('foo', 'BIG5', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> BIG5 -SELECT CONVERT('foo' USING utf_8_to_big5); +-- UTF8 --> BIG5 +SELECT CONVERT('foo' USING utf8_to_big5); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'BIG5'); +SELECT CONVERT('foo', 'UTF8', 'BIG5'); convert --------- foo (1 row) --- UNICODE --> KOI8R -SELECT CONVERT('foo' USING utf_8_to_koi8_r); +-- UTF8 --> KOI8R +SELECT CONVERT('foo' USING utf8_to_koi8_r); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'KOI8R'); +SELECT CONVERT('foo', 'UTF8', 'KOI8R'); convert --------- foo (1 row) --- KOI8R --> UNICODE -SELECT CONVERT('foo' USING koi8_r_to_utf_8); +-- KOI8R --> UTF8 +SELECT CONVERT('foo' USING koi8_r_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'KOI8R', 'UNICODE'); +SELECT CONVERT('foo', 'KOI8R', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> WIN1251 -SELECT CONVERT('foo' USING utf_8_to_windows_1251); +-- UTF8 --> WIN1251 +SELECT CONVERT('foo' USING utf8_to_windows_1251); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'WIN1251'); +SELECT CONVERT('foo', 'UTF8', 'WIN1251'); convert --------- foo (1 row) --- WIN1251 --> UNICODE -SELECT CONVERT('foo' USING windows_1251_to_utf_8); +-- WIN1251 --> UTF8 +SELECT CONVERT('foo' USING windows_1251_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'WIN1251', 'UNICODE'); +SELECT CONVERT('foo', 'WIN1251', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> ALT -SELECT CONVERT('foo' USING utf_8_to_windows_866); +-- UTF8 --> WIN866 +SELECT CONVERT('foo' USING utf8_to_windows_866); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'ALT'); +SELECT CONVERT('foo', 'UTF8', 'WIN866'); convert --------- foo (1 row) --- ALT --> UNICODE -SELECT CONVERT('foo' USING windows_866_to_utf_8); +-- WIN866 --> UTF8 +SELECT CONVERT('foo' USING windows_866_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ALT', 'UNICODE'); +SELECT CONVERT('foo', 'WIN866', 'UTF8'); convert --------- foo (1 row) --- EUC_CN --> UNICODE -SELECT CONVERT('foo' USING euc_cn_to_utf_8); +-- EUC_CN --> UTF8 +SELECT CONVERT('foo' USING euc_cn_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'EUC_CN', 'UNICODE'); +SELECT CONVERT('foo', 'EUC_CN', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> EUC_CN -SELECT CONVERT('foo' USING utf_8_to_euc_cn); +-- UTF8 --> EUC_CN +SELECT CONVERT('foo' USING utf8_to_euc_cn); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'EUC_CN'); +SELECT CONVERT('foo', 'UTF8', 'EUC_CN'); convert --------- foo (1 row) --- EUC_JP --> UNICODE -SELECT CONVERT('foo' USING euc_jp_to_utf_8); +-- EUC_JP --> UTF8 +SELECT CONVERT('foo' USING euc_jp_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'EUC_JP', 'UNICODE'); +SELECT CONVERT('foo', 'EUC_JP', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> EUC_JP -SELECT CONVERT('foo' USING utf_8_to_euc_jp); +-- UTF8 --> EUC_JP +SELECT CONVERT('foo' USING utf8_to_euc_jp); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'EUC_JP'); +SELECT CONVERT('foo', 'UTF8', 'EUC_JP'); convert --------- foo (1 row) --- EUC_KR --> UNICODE -SELECT CONVERT('foo' USING euc_kr_to_utf_8); +-- EUC_KR --> UTF8 +SELECT CONVERT('foo' USING euc_kr_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'EUC_KR', 'UNICODE'); +SELECT CONVERT('foo', 'EUC_KR', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> EUC_KR -SELECT CONVERT('foo' USING utf_8_to_euc_kr); +-- UTF8 --> EUC_KR +SELECT CONVERT('foo' USING utf8_to_euc_kr); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'EUC_KR'); +SELECT CONVERT('foo', 'UTF8', 'EUC_KR'); convert --------- foo (1 row) --- EUC_TW --> UNICODE -SELECT CONVERT('foo' USING euc_tw_to_utf_8); +-- EUC_TW --> UTF8 +SELECT CONVERT('foo' USING euc_tw_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'EUC_TW', 'UNICODE'); +SELECT CONVERT('foo', 'EUC_TW', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> EUC_TW -SELECT CONVERT('foo' USING utf_8_to_euc_tw); +-- UTF8 --> EUC_TW +SELECT CONVERT('foo' USING utf8_to_euc_tw); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'EUC_TW'); +SELECT CONVERT('foo', 'UTF8', 'EUC_TW'); convert --------- foo (1 row) --- GB18030 --> UNICODE -SELECT CONVERT('foo' USING gb18030_to_utf_8); +-- GB18030 --> UTF8 +SELECT CONVERT('foo' USING gb18030_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'GB18030', 'UNICODE'); +SELECT CONVERT('foo', 'GB18030', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> GB18030 -SELECT CONVERT('foo' USING utf_8_to_gb18030); +-- UTF8 --> GB18030 +SELECT CONVERT('foo' USING utf8_to_gb18030); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'GB18030'); +SELECT CONVERT('foo', 'UTF8', 'GB18030'); convert --------- foo (1 row) --- GBK --> UNICODE -SELECT CONVERT('foo' USING gbk_to_utf_8); +-- GBK --> UTF8 +SELECT CONVERT('foo' USING gbk_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'GBK', 'UNICODE'); +SELECT CONVERT('foo', 'GBK', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> GBK -SELECT CONVERT('foo' USING utf_8_to_gbk); +-- UTF8 --> GBK +SELECT CONVERT('foo' USING utf8_to_gbk); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'GBK'); +SELECT CONVERT('foo', 'UTF8', 'GBK'); convert --------- foo (1 row) --- UNICODE --> LATIN2 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_2); +-- UTF8 --> LATIN2 +SELECT CONVERT('foo' USING utf8_to_iso_8859_2); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN2'); +SELECT CONVERT('foo', 'UTF8', 'LATIN2'); convert --------- foo (1 row) --- LATIN2 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_2_to_utf_8); +-- LATIN2 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_2_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN2', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN2', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN3 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_3); +-- UTF8 --> LATIN3 +SELECT CONVERT('foo' USING utf8_to_iso_8859_3); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN3'); +SELECT CONVERT('foo', 'UTF8', 'LATIN3'); convert --------- foo (1 row) --- LATIN3 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_3_to_utf_8); +-- LATIN3 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_3_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN3', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN3', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN4 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_4); +-- UTF8 --> LATIN4 +SELECT CONVERT('foo' USING utf8_to_iso_8859_4); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN4'); +SELECT CONVERT('foo', 'UTF8', 'LATIN4'); convert --------- foo (1 row) --- LATIN4 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_4_to_utf_8); +-- LATIN4 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_4_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN4', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN4', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN5 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_9); +-- UTF8 --> LATIN5 +SELECT CONVERT('foo' USING utf8_to_iso_8859_9); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN5'); +SELECT CONVERT('foo', 'UTF8', 'LATIN5'); convert --------- foo (1 row) --- LATIN5 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_9_to_utf_8); +-- LATIN5 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_9_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN5', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN5', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN6 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_10); +-- UTF8 --> LATIN6 +SELECT CONVERT('foo' USING utf8_to_iso_8859_10); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN6'); +SELECT CONVERT('foo', 'UTF8', 'LATIN6'); convert --------- foo (1 row) --- LATIN6 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_10_to_utf_8); +-- LATIN6 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_10_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN6', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN6', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN7 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_13); +-- UTF8 --> LATIN7 +SELECT CONVERT('foo' USING utf8_to_iso_8859_13); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN7'); +SELECT CONVERT('foo', 'UTF8', 'LATIN7'); convert --------- foo (1 row) --- LATIN7 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_13_to_utf_8); +-- LATIN7 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_13_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN7', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN7', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN8 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_14); +-- UTF8 --> LATIN8 +SELECT CONVERT('foo' USING utf8_to_iso_8859_14); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN8'); +SELECT CONVERT('foo', 'UTF8', 'LATIN8'); convert --------- foo (1 row) --- LATIN8 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_14_to_utf_8); +-- LATIN8 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_14_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN8', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN8', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN9 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_15); +-- UTF8 --> LATIN9 +SELECT CONVERT('foo' USING utf8_to_iso_8859_15); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN9'); +SELECT CONVERT('foo', 'UTF8', 'LATIN9'); convert --------- foo (1 row) --- LATIN9 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_15_to_utf_8); +-- LATIN9 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_15_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN9', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN9', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN10 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_16); +-- UTF8 --> LATIN10 +SELECT CONVERT('foo' USING utf8_to_iso_8859_16); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN10'); +SELECT CONVERT('foo', 'UTF8', 'LATIN10'); convert --------- foo (1 row) --- LATIN10 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_16_to_utf_8); +-- LATIN10 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_16_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN10', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN10', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> ISO-8859-5 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_5); +-- UTF8 --> ISO-8859-5 +SELECT CONVERT('foo' USING utf8_to_iso_8859_5); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-5'); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-5'); convert --------- foo (1 row) --- ISO-8859-5 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_5_to_utf_8); +-- ISO-8859-5 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_5_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ISO-8859-5', 'UNICODE'); +SELECT CONVERT('foo', 'ISO-8859-5', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> ISO-8859-6 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_6); +-- UTF8 --> ISO-8859-6 +SELECT CONVERT('foo' USING utf8_to_iso_8859_6); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-6'); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-6'); convert --------- foo (1 row) --- ISO-8859-6 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_6_to_utf_8); +-- ISO-8859-6 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_6_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ISO-8859-6', 'UNICODE'); +SELECT CONVERT('foo', 'ISO-8859-6', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> ISO-8859-7 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_7); +-- UTF8 --> ISO-8859-7 +SELECT CONVERT('foo' USING utf8_to_iso_8859_7); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-7'); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-7'); convert --------- foo (1 row) --- ISO-8859-7 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_7_to_utf_8); +-- ISO-8859-7 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_7_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ISO-8859-7', 'UNICODE'); +SELECT CONVERT('foo', 'ISO-8859-7', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> ISO-8859-8 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_8); +-- UTF8 --> ISO-8859-8 +SELECT CONVERT('foo' USING utf8_to_iso_8859_8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-8'); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-8'); convert --------- foo (1 row) --- ISO-8859-8 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_8_to_utf_8); +-- ISO-8859-8 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_8_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'ISO-8859-8', 'UNICODE'); +SELECT CONVERT('foo', 'ISO-8859-8', 'UTF8'); convert --------- foo (1 row) --- LATIN1 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_1_to_utf_8); +-- LATIN1 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_1_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'LATIN1', 'UNICODE'); +SELECT CONVERT('foo', 'LATIN1', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> LATIN1 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_1); +-- UTF8 --> LATIN1 +SELECT CONVERT('foo' USING utf8_to_iso_8859_1); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'LATIN1'); +SELECT CONVERT('foo', 'UTF8', 'LATIN1'); convert --------- foo (1 row) --- JOHAB --> UNICODE -SELECT CONVERT('foo' USING johab_to_utf_8); +-- JOHAB --> UTF8 +SELECT CONVERT('foo' USING johab_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'JOHAB', 'UNICODE'); +SELECT CONVERT('foo', 'JOHAB', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> JOHAB -SELECT CONVERT('foo' USING utf_8_to_johab); +-- UTF8 --> JOHAB +SELECT CONVERT('foo' USING utf8_to_johab); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'JOHAB'); +SELECT CONVERT('foo', 'UTF8', 'JOHAB'); convert --------- foo (1 row) --- SJIS --> UNICODE -SELECT CONVERT('foo' USING sjis_to_utf_8); +-- SJIS --> UTF8 +SELECT CONVERT('foo' USING sjis_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'SJIS', 'UNICODE'); +SELECT CONVERT('foo', 'SJIS', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> SJIS -SELECT CONVERT('foo' USING utf_8_to_sjis); +-- UTF8 --> SJIS +SELECT CONVERT('foo' USING utf8_to_sjis); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'SJIS'); +SELECT CONVERT('foo', 'UTF8', 'SJIS'); convert --------- foo (1 row) --- TCVN --> UNICODE -SELECT CONVERT('foo' USING tcvn_to_utf_8); +-- WIN1258 --> UTF8 +SELECT CONVERT('foo' USING win1258_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'TCVN', 'UNICODE'); +SELECT CONVERT('foo', 'WIN1258', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> TCVN -SELECT CONVERT('foo' USING utf_8_to_tcvn); +-- UTF8 --> WIN1258 +SELECT CONVERT('foo' USING utf8_to_win1258); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'TCVN'); +SELECT CONVERT('foo', 'UTF8', 'WIN1258'); convert --------- foo (1 row) --- UHC --> UNICODE -SELECT CONVERT('foo' USING uhc_to_utf_8); +-- UHC --> UTF8 +SELECT CONVERT('foo' USING uhc_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UHC', 'UNICODE'); +SELECT CONVERT('foo', 'UHC', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> UHC -SELECT CONVERT('foo' USING utf_8_to_uhc); +-- UTF8 --> UHC +SELECT CONVERT('foo' USING utf8_to_uhc); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'UHC'); +SELECT CONVERT('foo', 'UTF8', 'UHC'); convert --------- foo (1 row) --- UNICODE --> WIN1250 -SELECT CONVERT('foo' USING utf_8_to_windows_1250); +-- UTF8 --> WIN1250 +SELECT CONVERT('foo' USING utf8_to_windows_1250); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'WIN1250'); +SELECT CONVERT('foo', 'UTF8', 'WIN1250'); convert --------- foo (1 row) --- WIN1250 --> UNICODE -SELECT CONVERT('foo' USING windows_1250_to_utf_8); +-- WIN1250 --> UTF8 +SELECT CONVERT('foo' USING windows_1250_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'WIN1250', 'UNICODE'); +SELECT CONVERT('foo', 'WIN1250', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> WIN1256 -SELECT CONVERT('foo' USING utf_8_to_windows_1256); +-- UTF8 --> WIN1256 +SELECT CONVERT('foo' USING utf8_to_windows_1256); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'WIN1256'); +SELECT CONVERT('foo', 'UTF8', 'WIN1256'); convert --------- foo (1 row) --- WIN1256 --> UNICODE -SELECT CONVERT('foo' USING windows_1256_to_utf_8); +-- WIN1256 --> UTF8 +SELECT CONVERT('foo' USING windows_1256_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'WIN1256', 'UNICODE'); +SELECT CONVERT('foo', 'WIN1256', 'UTF8'); convert --------- foo (1 row) --- UNICODE --> WIN874 -SELECT CONVERT('foo' USING utf_8_to_windows_874); +-- UTF8 --> WIN874 +SELECT CONVERT('foo' USING utf8_to_windows_874); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'UNICODE', 'WIN874'); +SELECT CONVERT('foo', 'UTF8', 'WIN874'); convert --------- foo (1 row) --- WIN874 --> UNICODE -SELECT CONVERT('foo' USING windows_874_to_utf_8); +-- WIN874 --> UTF8 +SELECT CONVERT('foo' USING windows_874_to_utf8); convert_using --------------- foo (1 row) -SELECT CONVERT('foo', 'WIN874', 'UNICODE'); +SELECT CONVERT('foo', 'WIN874', 'UTF8'); convert --------- foo diff --git a/src/test/regress/sql/conversion.sql b/src/test/regress/sql/conversion.sql index c84ffee95f..765064bc4f 100644 --- a/src/test/regress/sql/conversion.sql +++ b/src/test/regress/sql/conversion.sql @@ -3,19 +3,19 @@ -- CREATE USER conversion_test_user WITH NOCREATEDB NOCREATEUSER; SET SESSION AUTHORIZATION conversion_test_user; -CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- cannot make same name conversion in same schema -- -CREATE CONVERSION myconv FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE CONVERSION myconv FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- create default conversion with qualified name -- -CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE DEFAULT CONVERSION public.mydef FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- -- cannot make default conversion with same shcema/for_encoding/to_encoding -- -CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UNICODE' FROM iso8859_1_to_utf8; +CREATE DEFAULT CONVERSION public.mydef2 FOR 'LATIN1' TO 'UTF8' FROM iso8859_1_to_utf8; -- test comments COMMENT ON CONVERSION myconv_bad IS 'foo'; COMMENT ON CONVERSION myconv IS 'bar'; @@ -51,30 +51,30 @@ SELECT CONVERT('foo', 'WIN1251', 'MULE_INTERNAL'); -- MULE_INTERNAL --> WIN1251 SELECT CONVERT('foo' USING mic_to_windows_1251); SELECT CONVERT('foo', 'MULE_INTERNAL', 'WIN1251'); --- ALT --> MULE_INTERNAL +-- WIN866 --> MULE_INTERNAL SELECT CONVERT('foo' USING windows_866_to_mic); -SELECT CONVERT('foo', 'ALT', 'MULE_INTERNAL'); --- MULE_INTERNAL --> ALT +SELECT CONVERT('foo', 'WIN866', 'MULE_INTERNAL'); +-- MULE_INTERNAL --> WIN866 SELECT CONVERT('foo' USING mic_to_windows_866); -SELECT CONVERT('foo', 'MULE_INTERNAL', 'ALT'); +SELECT CONVERT('foo', 'MULE_INTERNAL', 'WIN866'); -- KOI8R --> WIN1251 SELECT CONVERT('foo' USING koi8_r_to_windows_1251); SELECT CONVERT('foo', 'KOI8R', 'WIN1251'); -- WIN1251 --> KOI8R SELECT CONVERT('foo' USING windows_1251_to_koi8_r); SELECT CONVERT('foo', 'WIN1251', 'KOI8R'); --- KOI8R --> ALT +-- KOI8R --> WIN866 SELECT CONVERT('foo' USING koi8_r_to_windows_866); -SELECT CONVERT('foo', 'KOI8R', 'ALT'); --- ALT --> KOI8R +SELECT CONVERT('foo', 'KOI8R', 'WIN866'); +-- WIN866 --> KOI8R SELECT CONVERT('foo' USING windows_866_to_koi8_r); -SELECT CONVERT('foo', 'ALT', 'KOI8R'); --- ALT --> WIN1251 +SELECT CONVERT('foo', 'WIN866', 'KOI8R'); +-- WIN866 --> WIN1251 SELECT CONVERT('foo' USING windows_866_to_windows_1251); -SELECT CONVERT('foo', 'ALT', 'WIN1251'); --- WIN1251 --> ALT +SELECT CONVERT('foo', 'WIN866', 'WIN1251'); +-- WIN1251 --> WIN866 SELECT CONVERT('foo' USING windows_1251_to_windows_866); -SELECT CONVERT('foo', 'WIN1251', 'ALT'); +SELECT CONVERT('foo', 'WIN1251', 'WIN866'); -- ISO-8859-5 --> KOI8R SELECT CONVERT('foo' USING iso_8859_5_to_koi8_r); SELECT CONVERT('foo', 'ISO-8859-5', 'KOI8R'); @@ -87,12 +87,12 @@ SELECT CONVERT('foo', 'ISO-8859-5', 'WIN1251'); -- WIN1251 --> ISO-8859-5 SELECT CONVERT('foo' USING windows_1251_to_iso_8859_5); SELECT CONVERT('foo', 'WIN1251', 'ISO-8859-5'); --- ISO-8859-5 --> ALT +-- ISO-8859-5 --> WIN866 SELECT CONVERT('foo' USING iso_8859_5_to_windows_866); -SELECT CONVERT('foo', 'ISO-8859-5', 'ALT'); --- ALT --> ISO-8859-5 +SELECT CONVERT('foo', 'ISO-8859-5', 'WIN866'); +-- WIN866 --> ISO-8859-5 SELECT CONVERT('foo' USING windows_866_to_iso_8859_5); -SELECT CONVERT('foo', 'ALT', 'ISO-8859-5'); +SELECT CONVERT('foo', 'WIN866', 'ISO-8859-5'); -- EUC_CN --> MULE_INTERNAL SELECT CONVERT('foo' USING euc_cn_to_mic); SELECT CONVERT('foo', 'EUC_CN', 'MULE_INTERNAL'); @@ -177,198 +177,198 @@ SELECT CONVERT('foo', 'LATIN4', 'MULE_INTERNAL'); -- MULE_INTERNAL --> LATIN4 SELECT CONVERT('foo' USING mic_to_iso_8859_4); SELECT CONVERT('foo', 'MULE_INTERNAL', 'LATIN4'); --- SQL_ASCII --> UNICODE -SELECT CONVERT('foo' USING ascii_to_utf_8); -SELECT CONVERT('foo', 'SQL_ASCII', 'UNICODE'); --- UNICODE --> SQL_ASCII -SELECT CONVERT('foo' USING utf_8_to_ascii); -SELECT CONVERT('foo', 'UNICODE', 'SQL_ASCII'); --- BIG5 --> UNICODE -SELECT CONVERT('foo' USING big5_to_utf_8); -SELECT CONVERT('foo', 'BIG5', 'UNICODE'); --- UNICODE --> BIG5 -SELECT CONVERT('foo' USING utf_8_to_big5); -SELECT CONVERT('foo', 'UNICODE', 'BIG5'); --- UNICODE --> KOI8R -SELECT CONVERT('foo' USING utf_8_to_koi8_r); -SELECT CONVERT('foo', 'UNICODE', 'KOI8R'); --- KOI8R --> UNICODE -SELECT CONVERT('foo' USING koi8_r_to_utf_8); -SELECT CONVERT('foo', 'KOI8R', 'UNICODE'); --- UNICODE --> WIN1251 -SELECT CONVERT('foo' USING utf_8_to_windows_1251); -SELECT CONVERT('foo', 'UNICODE', 'WIN1251'); --- WIN1251 --> UNICODE -SELECT CONVERT('foo' USING windows_1251_to_utf_8); -SELECT CONVERT('foo', 'WIN1251', 'UNICODE'); --- UNICODE --> ALT -SELECT CONVERT('foo' USING utf_8_to_windows_866); -SELECT CONVERT('foo', 'UNICODE', 'ALT'); --- ALT --> UNICODE -SELECT CONVERT('foo' USING windows_866_to_utf_8); -SELECT CONVERT('foo', 'ALT', 'UNICODE'); --- EUC_CN --> UNICODE -SELECT CONVERT('foo' USING euc_cn_to_utf_8); -SELECT CONVERT('foo', 'EUC_CN', 'UNICODE'); --- UNICODE --> EUC_CN -SELECT CONVERT('foo' USING utf_8_to_euc_cn); -SELECT CONVERT('foo', 'UNICODE', 'EUC_CN'); --- EUC_JP --> UNICODE -SELECT CONVERT('foo' USING euc_jp_to_utf_8); -SELECT CONVERT('foo', 'EUC_JP', 'UNICODE'); --- UNICODE --> EUC_JP -SELECT CONVERT('foo' USING utf_8_to_euc_jp); -SELECT CONVERT('foo', 'UNICODE', 'EUC_JP'); --- EUC_KR --> UNICODE -SELECT CONVERT('foo' USING euc_kr_to_utf_8); -SELECT CONVERT('foo', 'EUC_KR', 'UNICODE'); --- UNICODE --> EUC_KR -SELECT CONVERT('foo' USING utf_8_to_euc_kr); -SELECT CONVERT('foo', 'UNICODE', 'EUC_KR'); --- EUC_TW --> UNICODE -SELECT CONVERT('foo' USING euc_tw_to_utf_8); -SELECT CONVERT('foo', 'EUC_TW', 'UNICODE'); --- UNICODE --> EUC_TW -SELECT CONVERT('foo' USING utf_8_to_euc_tw); -SELECT CONVERT('foo', 'UNICODE', 'EUC_TW'); --- GB18030 --> UNICODE -SELECT CONVERT('foo' USING gb18030_to_utf_8); -SELECT CONVERT('foo', 'GB18030', 'UNICODE'); --- UNICODE --> GB18030 -SELECT CONVERT('foo' USING utf_8_to_gb18030); -SELECT CONVERT('foo', 'UNICODE', 'GB18030'); --- GBK --> UNICODE -SELECT CONVERT('foo' USING gbk_to_utf_8); -SELECT CONVERT('foo', 'GBK', 'UNICODE'); --- UNICODE --> GBK -SELECT CONVERT('foo' USING utf_8_to_gbk); -SELECT CONVERT('foo', 'UNICODE', 'GBK'); --- UNICODE --> LATIN2 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_2); -SELECT CONVERT('foo', 'UNICODE', 'LATIN2'); --- LATIN2 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_2_to_utf_8); -SELECT CONVERT('foo', 'LATIN2', 'UNICODE'); --- UNICODE --> LATIN3 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_3); -SELECT CONVERT('foo', 'UNICODE', 'LATIN3'); --- LATIN3 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_3_to_utf_8); -SELECT CONVERT('foo', 'LATIN3', 'UNICODE'); --- UNICODE --> LATIN4 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_4); -SELECT CONVERT('foo', 'UNICODE', 'LATIN4'); --- LATIN4 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_4_to_utf_8); -SELECT CONVERT('foo', 'LATIN4', 'UNICODE'); --- UNICODE --> LATIN5 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_9); -SELECT CONVERT('foo', 'UNICODE', 'LATIN5'); --- LATIN5 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_9_to_utf_8); -SELECT CONVERT('foo', 'LATIN5', 'UNICODE'); --- UNICODE --> LATIN6 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_10); -SELECT CONVERT('foo', 'UNICODE', 'LATIN6'); --- LATIN6 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_10_to_utf_8); -SELECT CONVERT('foo', 'LATIN6', 'UNICODE'); --- UNICODE --> LATIN7 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_13); -SELECT CONVERT('foo', 'UNICODE', 'LATIN7'); --- LATIN7 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_13_to_utf_8); -SELECT CONVERT('foo', 'LATIN7', 'UNICODE'); --- UNICODE --> LATIN8 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_14); -SELECT CONVERT('foo', 'UNICODE', 'LATIN8'); --- LATIN8 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_14_to_utf_8); -SELECT CONVERT('foo', 'LATIN8', 'UNICODE'); --- UNICODE --> LATIN9 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_15); -SELECT CONVERT('foo', 'UNICODE', 'LATIN9'); --- LATIN9 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_15_to_utf_8); -SELECT CONVERT('foo', 'LATIN9', 'UNICODE'); --- UNICODE --> LATIN10 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_16); -SELECT CONVERT('foo', 'UNICODE', 'LATIN10'); --- LATIN10 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_16_to_utf_8); -SELECT CONVERT('foo', 'LATIN10', 'UNICODE'); --- UNICODE --> ISO-8859-5 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_5); -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-5'); --- ISO-8859-5 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_5_to_utf_8); -SELECT CONVERT('foo', 'ISO-8859-5', 'UNICODE'); --- UNICODE --> ISO-8859-6 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_6); -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-6'); --- ISO-8859-6 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_6_to_utf_8); -SELECT CONVERT('foo', 'ISO-8859-6', 'UNICODE'); --- UNICODE --> ISO-8859-7 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_7); -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-7'); --- ISO-8859-7 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_7_to_utf_8); -SELECT CONVERT('foo', 'ISO-8859-7', 'UNICODE'); --- UNICODE --> ISO-8859-8 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_8); -SELECT CONVERT('foo', 'UNICODE', 'ISO-8859-8'); --- ISO-8859-8 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_8_to_utf_8); -SELECT CONVERT('foo', 'ISO-8859-8', 'UNICODE'); --- LATIN1 --> UNICODE -SELECT CONVERT('foo' USING iso_8859_1_to_utf_8); -SELECT CONVERT('foo', 'LATIN1', 'UNICODE'); --- UNICODE --> LATIN1 -SELECT CONVERT('foo' USING utf_8_to_iso_8859_1); -SELECT CONVERT('foo', 'UNICODE', 'LATIN1'); --- JOHAB --> UNICODE -SELECT CONVERT('foo' USING johab_to_utf_8); -SELECT CONVERT('foo', 'JOHAB', 'UNICODE'); --- UNICODE --> JOHAB -SELECT CONVERT('foo' USING utf_8_to_johab); -SELECT CONVERT('foo', 'UNICODE', 'JOHAB'); --- SJIS --> UNICODE -SELECT CONVERT('foo' USING sjis_to_utf_8); -SELECT CONVERT('foo', 'SJIS', 'UNICODE'); --- UNICODE --> SJIS -SELECT CONVERT('foo' USING utf_8_to_sjis); -SELECT CONVERT('foo', 'UNICODE', 'SJIS'); --- TCVN --> UNICODE -SELECT CONVERT('foo' USING tcvn_to_utf_8); -SELECT CONVERT('foo', 'TCVN', 'UNICODE'); --- UNICODE --> TCVN -SELECT CONVERT('foo' USING utf_8_to_tcvn); -SELECT CONVERT('foo', 'UNICODE', 'TCVN'); --- UHC --> UNICODE -SELECT CONVERT('foo' USING uhc_to_utf_8); -SELECT CONVERT('foo', 'UHC', 'UNICODE'); --- UNICODE --> UHC -SELECT CONVERT('foo' USING utf_8_to_uhc); -SELECT CONVERT('foo', 'UNICODE', 'UHC'); --- UNICODE --> WIN1250 -SELECT CONVERT('foo' USING utf_8_to_windows_1250); -SELECT CONVERT('foo', 'UNICODE', 'WIN1250'); --- WIN1250 --> UNICODE -SELECT CONVERT('foo' USING windows_1250_to_utf_8); -SELECT CONVERT('foo', 'WIN1250', 'UNICODE'); --- UNICODE --> WIN1256 -SELECT CONVERT('foo' USING utf_8_to_windows_1256); -SELECT CONVERT('foo', 'UNICODE', 'WIN1256'); --- WIN1256 --> UNICODE -SELECT CONVERT('foo' USING windows_1256_to_utf_8); -SELECT CONVERT('foo', 'WIN1256', 'UNICODE'); --- UNICODE --> WIN874 -SELECT CONVERT('foo' USING utf_8_to_windows_874); -SELECT CONVERT('foo', 'UNICODE', 'WIN874'); --- WIN874 --> UNICODE -SELECT CONVERT('foo' USING windows_874_to_utf_8); -SELECT CONVERT('foo', 'WIN874', 'UNICODE'); +-- SQL_ASCII --> UTF8 +SELECT CONVERT('foo' USING ascii_to_utf8); +SELECT CONVERT('foo', 'SQL_ASCII', 'UTF8'); +-- UTF8 --> SQL_ASCII +SELECT CONVERT('foo' USING utf8_to_ascii); +SELECT CONVERT('foo', 'UTF8', 'SQL_ASCII'); +-- BIG5 --> UTF8 +SELECT CONVERT('foo' USING big5_to_utf8); +SELECT CONVERT('foo', 'BIG5', 'UTF8'); +-- UTF8 --> BIG5 +SELECT CONVERT('foo' USING utf8_to_big5); +SELECT CONVERT('foo', 'UTF8', 'BIG5'); +-- UTF8 --> KOI8R +SELECT CONVERT('foo' USING utf8_to_koi8_r); +SELECT CONVERT('foo', 'UTF8', 'KOI8R'); +-- KOI8R --> UTF8 +SELECT CONVERT('foo' USING koi8_r_to_utf8); +SELECT CONVERT('foo', 'KOI8R', 'UTF8'); +-- UTF8 --> WIN1251 +SELECT CONVERT('foo' USING utf8_to_windows_1251); +SELECT CONVERT('foo', 'UTF8', 'WIN1251'); +-- WIN1251 --> UTF8 +SELECT CONVERT('foo' USING windows_1251_to_utf8); +SELECT CONVERT('foo', 'WIN1251', 'UTF8'); +-- UTF8 --> WIN866 +SELECT CONVERT('foo' USING utf8_to_windows_866); +SELECT CONVERT('foo', 'UTF8', 'WIN866'); +-- WIN866 --> UTF8 +SELECT CONVERT('foo' USING windows_866_to_utf8); +SELECT CONVERT('foo', 'WIN866', 'UTF8'); +-- EUC_CN --> UTF8 +SELECT CONVERT('foo' USING euc_cn_to_utf8); +SELECT CONVERT('foo', 'EUC_CN', 'UTF8'); +-- UTF8 --> EUC_CN +SELECT CONVERT('foo' USING utf8_to_euc_cn); +SELECT CONVERT('foo', 'UTF8', 'EUC_CN'); +-- EUC_JP --> UTF8 +SELECT CONVERT('foo' USING euc_jp_to_utf8); +SELECT CONVERT('foo', 'EUC_JP', 'UTF8'); +-- UTF8 --> EUC_JP +SELECT CONVERT('foo' USING utf8_to_euc_jp); +SELECT CONVERT('foo', 'UTF8', 'EUC_JP'); +-- EUC_KR --> UTF8 +SELECT CONVERT('foo' USING euc_kr_to_utf8); +SELECT CONVERT('foo', 'EUC_KR', 'UTF8'); +-- UTF8 --> EUC_KR +SELECT CONVERT('foo' USING utf8_to_euc_kr); +SELECT CONVERT('foo', 'UTF8', 'EUC_KR'); +-- EUC_TW --> UTF8 +SELECT CONVERT('foo' USING euc_tw_to_utf8); +SELECT CONVERT('foo', 'EUC_TW', 'UTF8'); +-- UTF8 --> EUC_TW +SELECT CONVERT('foo' USING utf8_to_euc_tw); +SELECT CONVERT('foo', 'UTF8', 'EUC_TW'); +-- GB18030 --> UTF8 +SELECT CONVERT('foo' USING gb18030_to_utf8); +SELECT CONVERT('foo', 'GB18030', 'UTF8'); +-- UTF8 --> GB18030 +SELECT CONVERT('foo' USING utf8_to_gb18030); +SELECT CONVERT('foo', 'UTF8', 'GB18030'); +-- GBK --> UTF8 +SELECT CONVERT('foo' USING gbk_to_utf8); +SELECT CONVERT('foo', 'GBK', 'UTF8'); +-- UTF8 --> GBK +SELECT CONVERT('foo' USING utf8_to_gbk); +SELECT CONVERT('foo', 'UTF8', 'GBK'); +-- UTF8 --> LATIN2 +SELECT CONVERT('foo' USING utf8_to_iso_8859_2); +SELECT CONVERT('foo', 'UTF8', 'LATIN2'); +-- LATIN2 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_2_to_utf8); +SELECT CONVERT('foo', 'LATIN2', 'UTF8'); +-- UTF8 --> LATIN3 +SELECT CONVERT('foo' USING utf8_to_iso_8859_3); +SELECT CONVERT('foo', 'UTF8', 'LATIN3'); +-- LATIN3 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_3_to_utf8); +SELECT CONVERT('foo', 'LATIN3', 'UTF8'); +-- UTF8 --> LATIN4 +SELECT CONVERT('foo' USING utf8_to_iso_8859_4); +SELECT CONVERT('foo', 'UTF8', 'LATIN4'); +-- LATIN4 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_4_to_utf8); +SELECT CONVERT('foo', 'LATIN4', 'UTF8'); +-- UTF8 --> LATIN5 +SELECT CONVERT('foo' USING utf8_to_iso_8859_9); +SELECT CONVERT('foo', 'UTF8', 'LATIN5'); +-- LATIN5 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_9_to_utf8); +SELECT CONVERT('foo', 'LATIN5', 'UTF8'); +-- UTF8 --> LATIN6 +SELECT CONVERT('foo' USING utf8_to_iso_8859_10); +SELECT CONVERT('foo', 'UTF8', 'LATIN6'); +-- LATIN6 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_10_to_utf8); +SELECT CONVERT('foo', 'LATIN6', 'UTF8'); +-- UTF8 --> LATIN7 +SELECT CONVERT('foo' USING utf8_to_iso_8859_13); +SELECT CONVERT('foo', 'UTF8', 'LATIN7'); +-- LATIN7 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_13_to_utf8); +SELECT CONVERT('foo', 'LATIN7', 'UTF8'); +-- UTF8 --> LATIN8 +SELECT CONVERT('foo' USING utf8_to_iso_8859_14); +SELECT CONVERT('foo', 'UTF8', 'LATIN8'); +-- LATIN8 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_14_to_utf8); +SELECT CONVERT('foo', 'LATIN8', 'UTF8'); +-- UTF8 --> LATIN9 +SELECT CONVERT('foo' USING utf8_to_iso_8859_15); +SELECT CONVERT('foo', 'UTF8', 'LATIN9'); +-- LATIN9 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_15_to_utf8); +SELECT CONVERT('foo', 'LATIN9', 'UTF8'); +-- UTF8 --> LATIN10 +SELECT CONVERT('foo' USING utf8_to_iso_8859_16); +SELECT CONVERT('foo', 'UTF8', 'LATIN10'); +-- LATIN10 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_16_to_utf8); +SELECT CONVERT('foo', 'LATIN10', 'UTF8'); +-- UTF8 --> ISO-8859-5 +SELECT CONVERT('foo' USING utf8_to_iso_8859_5); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-5'); +-- ISO-8859-5 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_5_to_utf8); +SELECT CONVERT('foo', 'ISO-8859-5', 'UTF8'); +-- UTF8 --> ISO-8859-6 +SELECT CONVERT('foo' USING utf8_to_iso_8859_6); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-6'); +-- ISO-8859-6 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_6_to_utf8); +SELECT CONVERT('foo', 'ISO-8859-6', 'UTF8'); +-- UTF8 --> ISO-8859-7 +SELECT CONVERT('foo' USING utf8_to_iso_8859_7); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-7'); +-- ISO-8859-7 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_7_to_utf8); +SELECT CONVERT('foo', 'ISO-8859-7', 'UTF8'); +-- UTF8 --> ISO-8859-8 +SELECT CONVERT('foo' USING utf8_to_iso_8859_8); +SELECT CONVERT('foo', 'UTF8', 'ISO-8859-8'); +-- ISO-8859-8 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_8_to_utf8); +SELECT CONVERT('foo', 'ISO-8859-8', 'UTF8'); +-- LATIN1 --> UTF8 +SELECT CONVERT('foo' USING iso_8859_1_to_utf8); +SELECT CONVERT('foo', 'LATIN1', 'UTF8'); +-- UTF8 --> LATIN1 +SELECT CONVERT('foo' USING utf8_to_iso_8859_1); +SELECT CONVERT('foo', 'UTF8', 'LATIN1'); +-- JOHAB --> UTF8 +SELECT CONVERT('foo' USING johab_to_utf8); +SELECT CONVERT('foo', 'JOHAB', 'UTF8'); +-- UTF8 --> JOHAB +SELECT CONVERT('foo' USING utf8_to_johab); +SELECT CONVERT('foo', 'UTF8', 'JOHAB'); +-- SJIS --> UTF8 +SELECT CONVERT('foo' USING sjis_to_utf8); +SELECT CONVERT('foo', 'SJIS', 'UTF8'); +-- UTF8 --> SJIS +SELECT CONVERT('foo' USING utf8_to_sjis); +SELECT CONVERT('foo', 'UTF8', 'SJIS'); +-- WIN1258 --> UTF8 +SELECT CONVERT('foo' USING win1258_to_utf8); +SELECT CONVERT('foo', 'WIN1258', 'UTF8'); +-- UTF8 --> WIN1258 +SELECT CONVERT('foo' USING utf8_to_win1258); +SELECT CONVERT('foo', 'UTF8', 'WIN1258'); +-- UHC --> UTF8 +SELECT CONVERT('foo' USING uhc_to_utf8); +SELECT CONVERT('foo', 'UHC', 'UTF8'); +-- UTF8 --> UHC +SELECT CONVERT('foo' USING utf8_to_uhc); +SELECT CONVERT('foo', 'UTF8', 'UHC'); +-- UTF8 --> WIN1250 +SELECT CONVERT('foo' USING utf8_to_windows_1250); +SELECT CONVERT('foo', 'UTF8', 'WIN1250'); +-- WIN1250 --> UTF8 +SELECT CONVERT('foo' USING windows_1250_to_utf8); +SELECT CONVERT('foo', 'WIN1250', 'UTF8'); +-- UTF8 --> WIN1256 +SELECT CONVERT('foo' USING utf8_to_windows_1256); +SELECT CONVERT('foo', 'UTF8', 'WIN1256'); +-- WIN1256 --> UTF8 +SELECT CONVERT('foo' USING windows_1256_to_utf8); +SELECT CONVERT('foo', 'WIN1256', 'UTF8'); +-- UTF8 --> WIN874 +SELECT CONVERT('foo' USING utf8_to_windows_874); +SELECT CONVERT('foo', 'UTF8', 'WIN874'); +-- WIN874 --> UTF8 +SELECT CONVERT('foo' USING windows_874_to_utf8); +SELECT CONVERT('foo', 'WIN874', 'UTF8'); -- -- return to the super user --