Commit 0cfa0add authored by bar@mysql.com's avatar bar@mysql.com

Bug #6819 Some ujis characters cannot be inserted into table

Allow to insert not-assigned UJIS codes. 
parent 192715db
This diff is collapsed.
This diff is collapsed.
......@@ -8243,7 +8243,6 @@ my_jisx0212_uni_onechar(int code){
}
/*
EUC-JP encoding subcomponents:
[x00-x7F] # ASCII/JIS-Roman (one-byte/character)
......@@ -8252,6 +8251,47 @@ my_jisx0212_uni_onechar(int code){
[xA1-xFE][xA1-xFE] # JIS X 0208:1997 (two bytes/char)
*/
static
uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
const char *beg, const char *end, uint pos)
{
const uchar *b= (uchar *) beg;
for ( ; pos && b < (uchar*) end; pos--, b++)
{
char *chbeg;
uint ch= *b;
if (ch <= 0x7F) /* one byte */
continue;
chbeg= (char *) b++;
if (b >= (uchar *) end) /* need more bytes */
return chbeg - beg; /* unexpected EOL */
if (ch == 0x8E) /* [x8E][xA0-xDF] */
{
if (*b >= 0xA0 && *b <= 0xDF)
continue;
return chbeg - beg; /* invalid sequence */
}
if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */
{
ch= *b++;
if (b >= (uchar*) end)
return chbeg - beg; /* unexpected EOL */
}
if (ch >= 0xA1 && ch <= 0xFE &&
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
continue;
return chbeg - beg; /* invalid sequence */
}
return b - (uchar *) beg;
}
static
uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)),
const char *str, const char *strend)
......@@ -8475,7 +8515,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_ujis,
my_numchars_mb,
my_charpos_mb,
my_well_formed_len_mb,
my_well_formed_len_ujis,
my_lengthsp_8bit,
my_numcells_eucjp,
my_mb_wc_euc_jp, /* mb_wc */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment