1998-03-15 08:39:04 +01:00
|
|
|
/*
|
1998-07-24 05:32:46 +02:00
|
|
|
* conversion functions between pg_wchar and multi-byte streams.
|
1998-03-15 08:39:04 +01:00
|
|
|
* Tatsuo Ishii
|
2000-10-12 08:06:50 +02:00
|
|
|
* $Id: wchar.c,v 1.13 2000/10/12 06:06:50 ishii Exp $
|
1999-07-12 00:47:21 +02:00
|
|
|
*
|
|
|
|
* WIN1250 client encoding updated by Pavel Behal
|
|
|
|
*
|
1998-03-15 08:39:04 +01:00
|
|
|
*/
|
1998-07-24 05:32:46 +02:00
|
|
|
|
|
|
|
#include "mb/pg_wchar.h"
|
1998-06-16 09:29:54 +02:00
|
|
|
|
1998-03-15 08:39:04 +01:00
|
|
|
/*
|
1998-06-16 09:29:54 +02:00
|
|
|
* conversion to pg_wchar is done by "table driven."
|
|
|
|
* to add an encoding support, define mb2wchar_with_len(), mblen()
|
|
|
|
* for the particular encoding. Note that if the encoding is only
|
1998-09-01 06:40:42 +02:00
|
|
|
* supported in the client, you don't need to define
|
1998-06-16 09:29:54 +02:00
|
|
|
* mb2wchar_with_len() function (SJIS is the case).
|
1998-03-15 08:39:04 +01:00
|
|
|
*/
|
1998-08-25 06:19:16 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* SQL/ASCII
|
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int pg_ascii2wchar_with_len
|
1998-09-01 06:40:42 +02:00
|
|
|
(const unsigned char *from, pg_wchar * to, int len)
|
1998-08-25 06:19:16 +02:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
int cnt = 0;
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
while (*from && len > 0)
|
|
|
|
{
|
|
|
|
*to++ = *from++;
|
|
|
|
len--;
|
2000-08-27 12:40:48 +02:00
|
|
|
cnt++;
|
1998-09-01 06:40:42 +02:00
|
|
|
}
|
|
|
|
*to = 0;
|
2000-08-27 12:40:48 +02:00
|
|
|
return(cnt);
|
1998-08-25 06:19:16 +02:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_ascii_mblen(const unsigned char *s)
|
1998-08-25 06:19:16 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
return (1);
|
1998-08-25 06:19:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* EUC
|
|
|
|
*/
|
|
|
|
|
2000-08-27 12:40:48 +02:00
|
|
|
static int pg_euc2wchar_with_len
|
1998-09-01 06:40:42 +02:00
|
|
|
(const unsigned char *from, pg_wchar * to, int len)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
int cnt = 0;
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
while (*from && len > 0)
|
|
|
|
{
|
|
|
|
if (*from == SS2)
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
len--;
|
|
|
|
*to = 0xff & *from++;
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
else if (*from == SS3)
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
*to = *from++ << 8;
|
|
|
|
*to |= 0x3f & *from++;
|
|
|
|
len -= 3;
|
|
|
|
}
|
|
|
|
else if (*from & 0x80)
|
|
|
|
{
|
|
|
|
*to = *from++ << 8;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*to = *from++;
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
to++;
|
2000-08-27 12:40:48 +02:00
|
|
|
cnt++;
|
1998-09-01 06:40:42 +02:00
|
|
|
}
|
|
|
|
*to = 0;
|
2000-08-27 12:40:48 +02:00
|
|
|
return(cnt);
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_euc_mblen(const unsigned char *s)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
int len;
|
1998-06-16 09:29:54 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
if (*s == SS2)
|
|
|
|
len = 2;
|
|
|
|
else if (*s == SS3)
|
|
|
|
len = 3;
|
|
|
|
else if (*s & 0x80)
|
|
|
|
len = 2;
|
|
|
|
else
|
|
|
|
len = 1;
|
|
|
|
return (len);
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
1998-06-16 09:29:54 +02:00
|
|
|
* EUC_JP
|
1998-03-15 08:39:04 +01:00
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int pg_eucjp2wchar_with_len
|
1998-09-01 06:40:42 +02:00
|
|
|
(const unsigned char *from, pg_wchar * to, int len)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
return(pg_euc2wchar_with_len(from, to, len));
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_eucjp_mblen(const unsigned char *s)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
return (pg_euc_mblen(s));
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
1998-06-16 09:29:54 +02:00
|
|
|
* EUC_KR
|
1998-03-15 08:39:04 +01:00
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int pg_euckr2wchar_with_len
|
1998-09-01 06:40:42 +02:00
|
|
|
(const unsigned char *from, pg_wchar * to, int len)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
return(pg_euc2wchar_with_len(from, to, len));
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_euckr_mblen(const unsigned char *s)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
return (pg_euc_mblen(s));
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
1998-06-16 09:29:54 +02:00
|
|
|
/*
|
|
|
|
* EUC_CN
|
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int pg_euccn2wchar_with_len
|
1998-09-01 06:40:42 +02:00
|
|
|
(const unsigned char *from, pg_wchar * to, int len)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
int cnt = 0;
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
while (*from && len > 0)
|
|
|
|
{
|
|
|
|
if (*from == SS2)
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
len--;
|
|
|
|
*to = 0x3f00 & (*from++ << 8);
|
|
|
|
*to = *from++;
|
|
|
|
len -= 2;
|
|
|
|
}
|
|
|
|
else if (*from == SS3)
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
*to = *from++ << 8;
|
|
|
|
*to |= 0x3f & *from++;
|
|
|
|
len -= 3;
|
|
|
|
}
|
|
|
|
else if (*from & 0x80)
|
|
|
|
{
|
|
|
|
*to = *from++ << 8;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*to = *from++;
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
to++;
|
2000-08-27 12:40:48 +02:00
|
|
|
cnt++;
|
1998-09-01 06:40:42 +02:00
|
|
|
}
|
|
|
|
*to = 0;
|
2000-08-27 12:40:48 +02:00
|
|
|
return(cnt);
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_euccn_mblen(const unsigned char *s)
|
1998-06-16 09:29:54 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
int len;
|
1998-06-16 09:29:54 +02:00
|
|
|
|
2000-01-25 03:12:27 +01:00
|
|
|
if (*s & 0x80)
|
1998-09-01 06:40:42 +02:00
|
|
|
len = 2;
|
|
|
|
else
|
|
|
|
len = 1;
|
|
|
|
return (len);
|
1998-06-16 09:29:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* EUC_TW
|
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int pg_euctw2wchar_with_len
|
1998-09-01 06:40:42 +02:00
|
|
|
(const unsigned char *from, pg_wchar * to, int len)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
int cnt = 0;
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
while (*from && len > 0)
|
|
|
|
{
|
|
|
|
if (*from == SS2)
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
len--;
|
|
|
|
*to = *from++ << 16;
|
|
|
|
*to |= *from++ << 8;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 3;
|
|
|
|
}
|
|
|
|
else if (*from == SS3)
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
*to = *from++ << 8;
|
|
|
|
*to |= 0x3f & *from++;
|
|
|
|
len -= 3;
|
|
|
|
}
|
|
|
|
else if (*from & 0x80)
|
|
|
|
{
|
|
|
|
*to = *from++ << 8;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*to = *from++;
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
to++;
|
2000-08-27 12:40:48 +02:00
|
|
|
cnt++;
|
1998-09-01 06:40:42 +02:00
|
|
|
}
|
|
|
|
*to = 0;
|
2000-08-27 12:40:48 +02:00
|
|
|
return(cnt);
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_euctw_mblen(const unsigned char *s)
|
1998-06-16 09:29:54 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
int len;
|
1998-06-16 09:29:54 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
if (*s == SS2)
|
|
|
|
len = 4;
|
|
|
|
else if (*s == SS3)
|
|
|
|
len = 3;
|
|
|
|
else if (*s & 0x80)
|
|
|
|
len = 2;
|
|
|
|
else
|
|
|
|
len = 1;
|
|
|
|
return (len);
|
1998-06-16 09:29:54 +02:00
|
|
|
}
|
|
|
|
|
1998-03-15 08:39:04 +01:00
|
|
|
/*
|
2000-10-12 08:06:50 +02:00
|
|
|
* convert UTF-8 string to pg_wchar (UCS-2)
|
1998-03-15 08:39:04 +01:00
|
|
|
* caller should allocate enough space for "to"
|
|
|
|
* len: length of from.
|
|
|
|
* "from" not necessarily null terminated.
|
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int
|
1998-09-01 06:40:42 +02:00
|
|
|
pg_utf2wchar_with_len(const unsigned char *from, pg_wchar * to, int len)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
unsigned char c1,
|
|
|
|
c2,
|
|
|
|
c3;
|
2000-08-27 12:40:48 +02:00
|
|
|
int cnt = 0;
|
1998-09-01 06:40:42 +02:00
|
|
|
|
|
|
|
while (*from && len > 0)
|
|
|
|
{
|
|
|
|
if ((*from & 0x80) == 0)
|
|
|
|
{
|
|
|
|
*to = *from++;
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
else if ((*from & 0xe0) == 0xc0)
|
|
|
|
{
|
|
|
|
c1 = *from++ & 0x1f;
|
|
|
|
c2 = *from++ & 0x3f;
|
|
|
|
len -= 2;
|
|
|
|
*to = c1 << 6;
|
|
|
|
*to |= c2;
|
|
|
|
}
|
|
|
|
else if ((*from & 0xe0) == 0xe0)
|
|
|
|
{
|
|
|
|
c1 = *from++ & 0x0f;
|
|
|
|
c2 = *from++ & 0x3f;
|
|
|
|
c3 = *from++ & 0x3f;
|
|
|
|
len -= 3;
|
|
|
|
*to = c1 << 12;
|
|
|
|
*to |= c2 << 6;
|
|
|
|
*to |= c3;
|
|
|
|
}
|
1999-04-25 22:35:51 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
*to = *from++;
|
|
|
|
len--;
|
|
|
|
}
|
1998-09-01 06:40:42 +02:00
|
|
|
to++;
|
2000-08-27 12:40:48 +02:00
|
|
|
cnt++;
|
1998-09-01 06:40:42 +02:00
|
|
|
}
|
|
|
|
*to = 0;
|
2000-08-27 12:40:48 +02:00
|
|
|
return(cnt);
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
2000-10-12 08:06:50 +02:00
|
|
|
/*
|
|
|
|
* returns the byte length of a UTF-8 word pointed to by s
|
|
|
|
*/
|
|
|
|
int
|
1998-09-01 06:40:42 +02:00
|
|
|
pg_utf_mblen(const unsigned char *s)
|
1998-06-16 09:29:54 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
int len = 1;
|
1998-06-16 09:29:54 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
if ((*s & 0x80) == 0)
|
|
|
|
len = 1;
|
|
|
|
else if ((*s & 0xe0) == 0xc0)
|
|
|
|
len = 2;
|
|
|
|
else if ((*s & 0xe0) == 0xe0)
|
|
|
|
len = 3;
|
|
|
|
return (len);
|
1998-06-16 09:29:54 +02:00
|
|
|
}
|
|
|
|
|
1998-03-15 08:39:04 +01:00
|
|
|
/*
|
|
|
|
* convert mule internal code to pg_wchar
|
|
|
|
* caller should allocate enough space for "to"
|
|
|
|
* len: length of from.
|
|
|
|
* "from" not necessarily null terminated.
|
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int
|
1998-09-01 06:40:42 +02:00
|
|
|
pg_mule2wchar_with_len(const unsigned char *from, pg_wchar * to, int len)
|
1998-03-15 08:39:04 +01:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
int cnt = 0;
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
while (*from && len > 0)
|
|
|
|
{
|
|
|
|
if (IS_LC1(*from))
|
|
|
|
{
|
|
|
|
*to = *from++ << 16;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 2;
|
|
|
|
}
|
|
|
|
else if (IS_LCPRV1(*from))
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
*to = *from++ << 16;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 3;
|
|
|
|
}
|
|
|
|
else if (IS_LC2(*from))
|
|
|
|
{
|
|
|
|
*to = *from++ << 16;
|
|
|
|
*to |= *from++ << 8;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 3;
|
|
|
|
}
|
|
|
|
else if (IS_LCPRV2(*from))
|
|
|
|
{
|
|
|
|
from++;
|
|
|
|
*to = *from++ << 16;
|
|
|
|
*to |= *from++ << 8;
|
|
|
|
*to |= *from++;
|
|
|
|
len -= 4;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ /* assume ASCII */
|
|
|
|
*to = (unsigned char) *from++;
|
|
|
|
len--;
|
|
|
|
}
|
|
|
|
to++;
|
2000-08-27 12:40:48 +02:00
|
|
|
cnt++;
|
1998-09-01 06:40:42 +02:00
|
|
|
}
|
|
|
|
*to = 0;
|
2000-08-27 12:40:48 +02:00
|
|
|
return(cnt);
|
1998-03-15 08:39:04 +01:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
int
|
|
|
|
pg_mule_mblen(const unsigned char *s)
|
1998-04-27 19:10:50 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
int len;
|
1998-04-27 19:10:50 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
if (IS_LC1(*s))
|
|
|
|
len = 2;
|
|
|
|
else if (IS_LCPRV1(*s))
|
|
|
|
len = 3;
|
|
|
|
else if (IS_LC2(*s))
|
|
|
|
len = 3;
|
|
|
|
else if (IS_LCPRV2(*s))
|
|
|
|
len = 4;
|
|
|
|
else
|
|
|
|
{ /* assume ASCII */
|
|
|
|
len = 1;
|
|
|
|
}
|
|
|
|
return (len);
|
1998-04-27 19:10:50 +02:00
|
|
|
}
|
|
|
|
|
1998-06-16 09:29:54 +02:00
|
|
|
/*
|
|
|
|
* ISO8859-1
|
|
|
|
*/
|
2000-08-27 12:40:48 +02:00
|
|
|
static int
|
1998-09-01 06:40:42 +02:00
|
|
|
pg_latin12wchar_with_len(const unsigned char *from, pg_wchar * to, int len)
|
1998-04-27 19:10:50 +02:00
|
|
|
{
|
2000-08-27 12:40:48 +02:00
|
|
|
int cnt = 0;
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
while (*from && len-- > 0)
|
2000-08-27 12:40:48 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
*to++ = *from++;
|
2000-08-27 12:40:48 +02:00
|
|
|
cnt++;
|
|
|
|
}
|
1998-09-01 06:40:42 +02:00
|
|
|
*to = 0;
|
2000-08-27 12:40:48 +02:00
|
|
|
return(cnt);
|
1998-04-27 19:10:50 +02:00
|
|
|
}
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_latin1_mblen(const unsigned char *s)
|
1998-04-27 19:10:50 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
return (1);
|
1998-04-27 19:10:50 +02:00
|
|
|
}
|
|
|
|
|
1998-06-16 09:29:54 +02:00
|
|
|
/*
|
|
|
|
* SJIS
|
|
|
|
*/
|
1998-09-01 06:40:42 +02:00
|
|
|
static int
|
|
|
|
pg_sjis_mblen(const unsigned char *s)
|
1998-04-27 19:10:50 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
int len;
|
1998-04-27 19:10:50 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
if (*s >= 0xa1 && *s <= 0xdf)
|
|
|
|
{ /* 1 byte kana? */
|
|
|
|
len = 1;
|
|
|
|
}
|
|
|
|
else if (*s > 0x7f)
|
|
|
|
{ /* kanji? */
|
|
|
|
len = 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ /* should be ASCII */
|
|
|
|
len = 1;
|
|
|
|
}
|
|
|
|
return (len);
|
1998-04-27 19:10:50 +02:00
|
|
|
}
|
|
|
|
|
1999-02-02 19:51:40 +01:00
|
|
|
/*
|
|
|
|
* 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);
|
|
|
|
}
|
|
|
|
|
1998-07-24 05:32:46 +02:00
|
|
|
pg_wchar_tbl pg_wchar_table[] = {
|
1999-03-24 08:02:17 +01:00
|
|
|
{pg_ascii2wchar_with_len, pg_ascii_mblen}, /* 0 */
|
|
|
|
{pg_eucjp2wchar_with_len, pg_eucjp_mblen}, /* 1 */
|
|
|
|
{pg_euccn2wchar_with_len, pg_euccn_mblen}, /* 2 */
|
|
|
|
{pg_euckr2wchar_with_len, pg_euckr_mblen}, /* 3 */
|
|
|
|
{pg_euctw2wchar_with_len, pg_euctw_mblen}, /* 4 */
|
|
|
|
{pg_utf2wchar_with_len, pg_utf_mblen}, /* 5 */
|
|
|
|
{pg_mule2wchar_with_len, pg_mule_mblen}, /* 6 */
|
1999-05-25 18:15:34 +02:00
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 7 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 8 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 9 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 10 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 11 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 12 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 13 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 14 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 15 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 16 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 17 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 18 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 19 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 20 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 21 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 22 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 23 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 24 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 25 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 26 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 27 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 28 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 29 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 30 */
|
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen}, /* 31 */
|
|
|
|
{0, pg_sjis_mblen}, /* 32 */
|
1999-07-12 00:47:21 +02:00
|
|
|
{0, pg_big5_mblen}, /* 33 */
|
2000-04-12 19:17:23 +02:00
|
|
|
{pg_latin12wchar_with_len, pg_latin1_mblen} /* 34 */
|
1998-06-16 09:29:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* returns the byte length of a word for mule internal code */
|
1998-09-01 06:40:42 +02:00
|
|
|
int
|
|
|
|
pg_mic_mblen(const unsigned char *mbstr)
|
1998-06-16 09:29:54 +02:00
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
return (pg_mule_mblen(mbstr));
|
1998-06-16 09:29:54 +02:00
|
|
|
}
|