41 static int euc_tw2big5(
const unsigned char *euc,
unsigned char *p,
int len,
bool noError);
42 static int big52euc_tw(
const unsigned char *big5,
unsigned char *p,
int len,
bool noError);
43 static int big52mic(
const unsigned char *big5,
unsigned char *p,
int len,
bool noError);
44 static int mic2big5(
const unsigned char *mic,
unsigned char *p,
int len,
bool noError);
45 static int euc_tw2mic(
const unsigned char *euc,
unsigned char *p,
int len,
bool noError);
46 static int mic2euc_tw(
const unsigned char *mic,
unsigned char *p,
int len,
bool noError);
151 const unsigned char *
start = euc;
153 unsigned short big5buf,
170 (
const char *) euc,
len);
181 cnsBuf = (euc[2] << 8) | euc[3];
186 cnsBuf = (c1 << 8) | euc[1];
196 (
const char *) euc,
len);
198 *p++ = (big5buf >> 8) & 0x00ff;
199 *p++ = big5buf & 0x00ff;
211 (
const char *) euc,
len);
229 const unsigned char *
start = big5;
231 unsigned short big5buf,
248 (
const char *) big5,
len);
250 big5buf = (c1 << 8) | big5[1];
255 *p++ = (cnsBuf >> 8) & 0x00ff;
256 *p++ = cnsBuf & 0x00ff;
262 *p++ = (cnsBuf >> 8) & 0x00ff;
263 *p++ = cnsBuf & 0x00ff;
269 *p++ = (cnsBuf >> 8) & 0x00ff;
270 *p++ = cnsBuf & 0x00ff;
277 (
const char *) big5,
len);
291 (
const char *) big5,
len);
308 euc_tw2mic(
const unsigned char *euc,
unsigned char *p,
int len,
bool noError)
310 const unsigned char *
start = euc;
325 (
const char *) euc,
len);
359 (
const char *) euc,
len);
375 mic2euc_tw(
const unsigned char *mic,
unsigned char *p,
int len,
bool noError)
377 const unsigned char *
start = mic;
392 (
const char *) mic,
len);
405 (
const char *) mic,
len);
432 (
const char *) mic,
len);
446 big52mic(
const unsigned char *big5,
unsigned char *p,
int len,
bool noError)
448 const unsigned char *
start = big5;
450 unsigned short big5buf,
466 (
const char *) big5,
len);
479 (
const char *) big5,
len);
481 big5buf = (c1 << 8) | big5[1];
489 *p++ = (cnsBuf >> 8) & 0x00ff;
490 *p++ = cnsBuf & 0x00ff;
497 (
const char *) big5,
len);
511 mic2big5(
const unsigned char *mic,
unsigned char *p,
int len,
bool noError)
513 const unsigned char *
start = mic;
515 unsigned short big5buf,
530 (
const char *) mic,
len);
543 (
const char *) mic,
len);
550 cnsBuf = (mic[2] << 8) | mic[3];
554 cnsBuf = (mic[1] << 8) | mic[2];
562 (
const char *) mic,
len);
564 *p++ = (big5buf >> 8) & 0x00ff;
565 *p++ = big5buf & 0x00ff;
572 (
const char *) mic,
len);
unsigned short CNStoBIG5(unsigned short cns, unsigned char lc)
unsigned short BIG5toCNS(unsigned short big5, unsigned char *lc)
#define IS_HIGHBIT_SET(ch)
static int euc_tw2mic(const unsigned char *euc, unsigned char *p, int len, bool noError)
static int big52mic(const unsigned char *big5, unsigned char *p, int len, bool noError)
Datum euc_tw_to_mic(PG_FUNCTION_ARGS)
Datum big5_to_euc_tw(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(euc_tw_to_big5)
Datum mic_to_big5(PG_FUNCTION_ARGS)
Datum big5_to_mic(PG_FUNCTION_ARGS)
Datum euc_tw_to_big5(PG_FUNCTION_ARGS)
static int mic2euc_tw(const unsigned char *mic, unsigned char *p, int len, bool noError)
Datum mic_to_euc_tw(PG_FUNCTION_ARGS)
static int mic2big5(const unsigned char *mic, unsigned char *p, int len, bool noError)
static int euc_tw2big5(const unsigned char *euc, unsigned char *p, int len, bool noError)
static int big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError)
#define PG_GETARG_CSTRING(n)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_GETARG_BOOL(n)
void report_untranslatable_char(int src_encoding, int dest_encoding, const char *mbstr, int len)
void report_invalid_encoding(int encoding, const char *mbstr, int len)
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding)
int pg_encoding_verifymbchar(int encoding, const char *mbstr, int len)