@@ -2071,52 +2071,51 @@ pg_utf8_islegal(const unsigned char *source, int length)
20712071/*
20722072 *-------------------------------------------------------------------
20732073 * encoding info table
2074- * XXX must be sorted by the same order as enum pg_enc (in mb/pg_wchar.h)
20752074 *-------------------------------------------------------------------
20762075 */
20772076const pg_wchar_tbl pg_wchar_table [] = {
2078- {pg_ascii2wchar_with_len , pg_wchar2single_with_len , pg_ascii_mblen , pg_ascii_dsplen , pg_ascii_verifychar , pg_ascii_verifystr , 1 }, /* PG_SQL_ASCII */
2079- {pg_eucjp2wchar_with_len , pg_wchar2euc_with_len , pg_eucjp_mblen , pg_eucjp_dsplen , pg_eucjp_verifychar , pg_eucjp_verifystr , 3 }, /* PG_EUC_JP */
2080- {pg_euccn2wchar_with_len , pg_wchar2euc_with_len , pg_euccn_mblen , pg_euccn_dsplen , pg_euccn_verifychar , pg_euccn_verifystr , 2 }, /* PG_EUC_CN */
2081- {pg_euckr2wchar_with_len , pg_wchar2euc_with_len , pg_euckr_mblen , pg_euckr_dsplen , pg_euckr_verifychar , pg_euckr_verifystr , 3 }, /* PG_EUC_KR */
2082- {pg_euctw2wchar_with_len , pg_wchar2euc_with_len , pg_euctw_mblen , pg_euctw_dsplen , pg_euctw_verifychar , pg_euctw_verifystr , 4 }, /* PG_EUC_TW */
2083- {pg_eucjp2wchar_with_len , pg_wchar2euc_with_len , pg_eucjp_mblen , pg_eucjp_dsplen , pg_eucjp_verifychar , pg_eucjp_verifystr , 3 }, /* PG_EUC_JIS_2004 */
2084- {pg_utf2wchar_with_len , pg_wchar2utf_with_len , pg_utf_mblen , pg_utf_dsplen , pg_utf8_verifychar , pg_utf8_verifystr , 4 }, /* PG_UTF8 */
2085- {pg_mule2wchar_with_len , pg_wchar2mule_with_len , pg_mule_mblen , pg_mule_dsplen , pg_mule_verifychar , pg_mule_verifystr , 4 }, /* PG_MULE_INTERNAL */
2086- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN1 */
2087- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN2 */
2088- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN3 */
2089- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN4 */
2090- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN5 */
2091- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN6 */
2092- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN7 */
2093- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN8 */
2094- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN9 */
2095- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_LATIN10 */
2096- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1256 */
2097- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1258 */
2098- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN866 */
2099- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN874 */
2100- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_KOI8R */
2101- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1251 */
2102- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1252 */
2103- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* ISO-8859-5 */
2104- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* ISO-8859-6 */
2105- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* ISO-8859-7 */
2106- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* ISO-8859-8 */
2107- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1250 */
2108- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1253 */
2109- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1254 */
2110- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1255 */
2111- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_WIN1257 */
2112- {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 }, /* PG_KOI8U */
2113- {0 , 0 , pg_sjis_mblen , pg_sjis_dsplen , pg_sjis_verifychar , pg_sjis_verifystr , 2 }, /* PG_SJIS */
2114- {0 , 0 , pg_big5_mblen , pg_big5_dsplen , pg_big5_verifychar , pg_big5_verifystr , 2 }, /* PG_BIG5 */
2115- {0 , 0 , pg_gbk_mblen , pg_gbk_dsplen , pg_gbk_verifychar , pg_gbk_verifystr , 2 }, /* PG_GBK */
2116- {0 , 0 , pg_uhc_mblen , pg_uhc_dsplen , pg_uhc_verifychar , pg_uhc_verifystr , 2 }, /* PG_UHC */
2117- {0 , 0 , pg_gb18030_mblen , pg_gb18030_dsplen , pg_gb18030_verifychar , pg_gb18030_verifystr , 4 }, /* PG_GB18030 */
2118- {0 , 0 , pg_johab_mblen , pg_johab_dsplen , pg_johab_verifychar , pg_johab_verifystr , 3 }, /* PG_JOHAB */
2119- {0 , 0 , pg_sjis_mblen , pg_sjis_dsplen , pg_sjis_verifychar , pg_sjis_verifystr , 2 } /* PG_SHIFT_JIS_2004 */
2077+ [ PG_SQL_ASCII ] = {pg_ascii2wchar_with_len , pg_wchar2single_with_len , pg_ascii_mblen , pg_ascii_dsplen , pg_ascii_verifychar , pg_ascii_verifystr , 1 },
2078+ [ PG_EUC_JP ] = {pg_eucjp2wchar_with_len , pg_wchar2euc_with_len , pg_eucjp_mblen , pg_eucjp_dsplen , pg_eucjp_verifychar , pg_eucjp_verifystr , 3 },
2079+ [ PG_EUC_CN ] = {pg_euccn2wchar_with_len , pg_wchar2euc_with_len , pg_euccn_mblen , pg_euccn_dsplen , pg_euccn_verifychar , pg_euccn_verifystr , 2 },
2080+ [ PG_EUC_KR ] = {pg_euckr2wchar_with_len , pg_wchar2euc_with_len , pg_euckr_mblen , pg_euckr_dsplen , pg_euckr_verifychar , pg_euckr_verifystr , 3 },
2081+ [ PG_EUC_TW ] = {pg_euctw2wchar_with_len , pg_wchar2euc_with_len , pg_euctw_mblen , pg_euctw_dsplen , pg_euctw_verifychar , pg_euctw_verifystr , 4 },
2082+ [ PG_EUC_JIS_2004 ] = {pg_eucjp2wchar_with_len , pg_wchar2euc_with_len , pg_eucjp_mblen , pg_eucjp_dsplen , pg_eucjp_verifychar , pg_eucjp_verifystr , 3 },
2083+ [ PG_UTF8 ] = {pg_utf2wchar_with_len , pg_wchar2utf_with_len , pg_utf_mblen , pg_utf_dsplen , pg_utf8_verifychar , pg_utf8_verifystr , 4 },
2084+ [ PG_MULE_INTERNAL ] = {pg_mule2wchar_with_len , pg_wchar2mule_with_len , pg_mule_mblen , pg_mule_dsplen , pg_mule_verifychar , pg_mule_verifystr , 4 },
2085+ [ PG_LATIN1 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2086+ [ PG_LATIN2 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2087+ [ PG_LATIN3 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2088+ [ PG_LATIN4 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2089+ [ PG_LATIN5 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2090+ [ PG_LATIN6 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2091+ [ PG_LATIN7 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2092+ [ PG_LATIN8 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2093+ [ PG_LATIN9 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2094+ [ PG_LATIN10 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2095+ [ PG_WIN1256 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2096+ [ PG_WIN1258 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2097+ [ PG_WIN866 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2098+ [ PG_WIN874 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2099+ [ PG_KOI8R ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2100+ [ PG_WIN1251 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2101+ [ PG_WIN1252 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2102+ [ PG_ISO_8859_5 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2103+ [ PG_ISO_8859_6 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2104+ [ PG_ISO_8859_7 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2105+ [ PG_ISO_8859_8 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2106+ [ PG_WIN1250 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2107+ [ PG_WIN1253 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2108+ [ PG_WIN1254 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2109+ [ PG_WIN1255 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2110+ [ PG_WIN1257 ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2111+ [ PG_KOI8U ] = {pg_latin12wchar_with_len , pg_wchar2single_with_len , pg_latin1_mblen , pg_latin1_dsplen , pg_latin1_verifychar , pg_latin1_verifystr , 1 },
2112+ [ PG_SJIS ] = {0 , 0 , pg_sjis_mblen , pg_sjis_dsplen , pg_sjis_verifychar , pg_sjis_verifystr , 2 },
2113+ [ PG_BIG5 ] = {0 , 0 , pg_big5_mblen , pg_big5_dsplen , pg_big5_verifychar , pg_big5_verifystr , 2 },
2114+ [ PG_GBK ] = {0 , 0 , pg_gbk_mblen , pg_gbk_dsplen , pg_gbk_verifychar , pg_gbk_verifystr , 2 },
2115+ [ PG_UHC ] = {0 , 0 , pg_uhc_mblen , pg_uhc_dsplen , pg_uhc_verifychar , pg_uhc_verifystr , 2 },
2116+ [ PG_GB18030 ] = {0 , 0 , pg_gb18030_mblen , pg_gb18030_dsplen , pg_gb18030_verifychar , pg_gb18030_verifystr , 4 },
2117+ [ PG_JOHAB ] = {0 , 0 , pg_johab_mblen , pg_johab_dsplen , pg_johab_verifychar , pg_johab_verifystr , 3 },
2118+ [ PG_SHIFT_JIS_2004 ] = {0 , 0 , pg_sjis_mblen , pg_sjis_dsplen , pg_sjis_verifychar , pg_sjis_verifystr , 2 },
21202119};
21212120
21222121/*
0 commit comments