1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Included patches make some enhancements to the multi-byte support.

o allow to use Big5 (a Chinese encoding used in Taiwan) as a client
  encoding. In this case the server side encoding should be EUC_TW

o add EUC_TW and Big5 test cases to the regression and the mb test
  (contributed by Jonah Kuo)

o fix mistake in include/mb/pg_wchar.h. An encoding id for EUC_TW was
  not correct (was 3 and now is 4)

o update documents (doc/README.mb and README.mb.jp)

o update psql helpfile (bin/psql/psqlHelp.h)

--
Tatsuo Ishii
t-ishii@sra.co.jp
This commit is contained in:
Bruce Momjian
1999-02-02 18:51:40 +00:00
parent 8358a8f6a0
commit a7ad43cd18
13 changed files with 605 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
/*
* conversion functions between pg_wchar and multi-byte streams.
* Tatsuo Ishii
* $Id: wchar.c,v 1.4 1998/09/01 04:33:26 momjian Exp $
* $Id: wchar.c,v 1.5 1999/02/02 18:51:23 momjian Exp $
*/
#include "mb/pg_wchar.h"
@@ -396,6 +396,25 @@ pg_sjis_mblen(const unsigned char *s)
return (len);
}
/*
* Big5
*/
static int
pg_big5_mblen(const unsigned char *s)
{
int len;
if (*s > 0x7f)
{ /* kanji? */
len = 2;
}
else
{ /* should be ASCII */
len = 1;
}
return (len);
}
pg_wchar_tbl pg_wchar_table[] = {
{pg_ascii2wchar_with_len, pg_ascii_mblen},
{pg_eucjp2wchar_with_len, pg_eucjp_mblen},
@@ -429,7 +448,8 @@ pg_wchar_tbl pg_wchar_table[] = {
{0, 0},
{0, 0},
{0, 0},
{0, pg_sjis_mblen}
{0, pg_sjis_mblen},
{0, pg_big5_mblen}
};
/* returns the byte length of a word for mule internal code */