* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.57 2005/12/25 02:14:17 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.58 2005/12/26 19:30:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
len -= pg_mic_mblen(mic++);
- if (c1 <= 0x7f) /* ASCII */
+ if (!IS_HIGHBIT_SET(c1)) /* ASCII */
*p++ = c1;
else if (c1 >= 0x81 && c1 <= 0xfe)
{
while (len-- > 0 && (c1 = *l++))
{
- if (c1 > 0x7f)
- { /* Latin? */
- *p++ = lc;
- }
+ if (IS_HIGHBIT_SET(c1))
+ *p++ = lc; /* Latin? */
*p++ = c1;
}
*p = '\0';
if (c1 == lc)
*p++ = *mic++;
- else if (c1 > 0x7f)
+ else if (IS_HIGHBIT_SET(c1))
{
mic--;
pg_print_bogus_char(&mic, &p);
while (len-- > 0 && (c1 = *mic))
{
- if (c1 > 0x7f)
+ if (IS_HIGHBIT_SET(c1))
pg_print_bogus_char(&mic, &p);
else
{ /* should be ASCII */
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c,v 1.11 2005/12/25 02:14:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c,v 1.12 2005/12/26 19:30:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*p++ = *mic++;
*p++ = *mic++;
}
- else if (c1 > 0x7f)
+ else if (IS_HIGHBIT_SET(c1))
{ /* cannot convert to EUC_CN! */
mic--;
pg_print_bogus_char(&mic, &p);
}
else
- { /* should be ASCII */
- *p++ = c1;
- }
+ *p++ = c1; /* should be ASCII */
}
*p = '\0';
}
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c,v 1.13 2005/10/15 02:49:34 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c,v 1.14 2005/12/26 19:30:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*p++ = LC_JISX0201K;
*p++ = c1;
}
- else if (c1 > 0x7f)
+ else if (IS_HIGHBIT_SET(c1))
{
/*
* JIS X0208, X0212, user defined extended characters
}
}
}
- else if (c1 > 0x7f)
+ else if (IS_HIGHBIT_SET(c1))
{
/* cannot convert to SJIS! */
*p++ = PGSJISALTCODE >> 8;
*p++ = PGSJISALTCODE & 0xff;
}
else
- { /* should be ASCII */
- *p++ = c1;
- }
+ *p++ = c1; /* should be ASCII */
}
*p = '\0';
}
*p++ = *mic++;
*p++ = *mic++;
}
- else if (c1 > 0x7f)
+ else if (IS_HIGHBIT_SET(c1))
{ /* cannot convert to EUC_JP! */
mic--;
pg_print_bogus_char(&mic, &p);
}
else
- { /* should be ASCII */
- *p++ = c1;
- }
+ *p++ = c1; /* should be ASCII */
}
*p = '\0';
}
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c,v 1.11 2005/12/25 02:14:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c,v 1.12 2005/12/26 19:30:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*p++ = *mic++;
*p++ = *mic++;
}
- else if (c1 > 0x7f)
+ else if (IS_HIGHBIT_SET(c1))
{ /* cannot convert to EUC_KR! */
mic--;
pg_print_bogus_char(&mic, &p);
}
else
- { /* should be ASCII */
- *p++ = c1;
- }
+ *p++ = c1; /* should be ASCII */
}
*p = '\0';
}
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c,v 1.11 2005/12/25 02:14:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c,v 1.12 2005/12/26 19:30:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*p++ = *mic++;
*p++ = *mic++;
}
- else if (c1 > 0x7f)
+ else if (IS_HIGHBIT_SET(c1))
{ /* cannot convert to EUC_TW! */
mic--;
pg_print_bogus_char(&mic, &p);
}
else
- { /* should be ASCII */
- *p++ = c1;
- }
+ *p++ = c1; /* should be ASCII */
}
*p = '\0';
}
while (len >= 0 && (c1 = *big5++))
{
- if (c1 <= 0x7fU)
+ if (!IS_HIGHBIT_SET(c1))
{ /* ASCII */
len--;
*p++ = c1;
*p++ = big5buf & 0x00ff;
}
}
- else if (c1 <= 0x7f) /* ASCII */
+ else if (!IS_HIGHBIT_SET(c1)) /* ASCII */
*p++ = c1;
else
{ /* cannot convert to Big5! */
/*
* conversion functions between pg_wchar and multibyte streams.
* Tatsuo Ishii
- * $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.51 2005/12/25 02:14:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.52 2005/12/26 19:30:44 momjian Exp $
*
* WIN1250 client encoding updated by Pavel Behal
*
if (*s >= 0xa1 && *s <= 0xdf)
len = 1; /* 1 byte kana? */
- else if (*s > 0x7f)
+ else if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
len = 1; /* should be ASCII */
if (*s >= 0xa1 && *s <= 0xdf)
len = 1; /* 1 byte kana? */
- else if (*s > 0x7f)
+ else if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
len = 1; /* should be ASCII */
{
int len;
- if (*s > 0x7f)
+ if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
len = 1; /* should be ASCII */
{
int len;
- if (*s > 0x7f)
+ if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
len = 1; /* should be ASCII */
{
int len;
- if (*s > 0x7f)
+ if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
len = 1; /* should be ASCII */
{
int len;
- if (*s > 0x7f)
+ if (IS_HIGHBIT_SET(*s))
len = 2; /* kanji? */
else
len = 1; /* should be ASCII */
{
int len;
- if (*s > 0x7f)
+ if (IS_HIGHBIT_SET(*s))
len = 2; /* 2byte? */
else
len = 1; /* should be ASCII */
{
int len;
- if (*s > 0x7f)
+ if (IS_HIGHBIT_SET(*s))
len = 2; /* 2byte? */
else
len = 1; /* should be ASCII */
{
int len;
- if (*s <= 0x7f)
+ if (!IS_HIGHBIT_SET(*s))
len = 1; /* ASCII */
else
{
{
int len;
- if (*s <= 0x7f)
+ if (!IS_HIGHBIT_SET(*s))
len = 1; /* ASCII */
else
len = 2;