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

o note that now pg_database has a new attribuite "encoding" even

if MULTIBYTE is not enabled. So be sure to run initdb.

o these patches are made against the latest source tree (after
Bruce's massive patch, I think) BTW, I noticed that after running
regression, the oid field of pg_type seems disappeared.

	regression=> select oid from pg_type; ERROR:  attribute
	'oid' not found

this happens after the constraints test. This occures with/without
my patches. strange...

o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer
used, and shoud be removed.

o GetDatabaseInfo() in utils/misc/database.c removed (actually in
#ifdef 0). seems nobody uses.

t-ishii@sra.co.jp
This commit is contained in:
Bruce Momjian
1998-08-24 01:14:24 +00:00
parent 9438fe5d09
commit c0b01461db
27 changed files with 171 additions and 815 deletions

View File

@@ -2,7 +2,7 @@
* conversion between client encoding and server internal encoding
* (currently mule internal code (mic) is used)
* Tatsuo Ishii
* $Id: conv.c,v 1.1 1998/07/24 03:31:56 scrappy Exp $
* $Id: conv.c,v 1.2 1998/08/24 01:13:59 momjian Exp $
*/
#include <stdio.h>
#include <string.h>
@@ -369,7 +369,38 @@ static void mic2latin5(unsigned char *mic, unsigned char *p, int len)
mic2latin(mic, p, len, LC_ISO8859_5);
}
/*
* ASCII ---> MIC
*/
static void ascii2mic(unsigned char *l, unsigned char *p, int len)
{
int c1;
while (len-- > 0 && (c1 = *l++)) {
*p++ = (c1 & 0x7f);
}
*p = '\0';
}
/*
* MIC ---> ASCII
*/
static void mic2ascii(unsigned char *mic, unsigned char *p, int len)
{
int c1;
while (len > 0 && (c1 = *mic)) {
if (c1 > 0x7f) {
printBogusChar(&mic, &p);
} else { /* should be ASCII */
*p++ = c1;
}
}
*p = '\0';
}
pg_encoding_conv_tbl pg_conv_tbl[] = {
{SQL_ASCII, "SQL_ASCII", 0, ascii2mic, mic2ascii}, /* SQL/ACII */
{EUC_JP, "EUC_JP", 0, euc_jp2mic, mic2euc_jp}, /* EUC_JP */
{EUC_CN, "EUC_CN", 0, euc_cn2mic, mic2euc_cn}, /* EUC_CN */
{EUC_KR, "EUC_KR", 0, euc_kr2mic, mic2euc_kr}, /* EUC_KR */