sjisにおける日本語特殊文字対応の追加実装は12ヶ月前に完了済み
な、なんだってー!って思うのは僕だけでしょうか.
MySQL - fast and reliable SQL database Changes for strings/ctype-sjis.c@1.71 Age Author Annotate Comments 12 months bar@mysql.com 1.71 Allow cp932 characters to be stored in a SJIS column --- 1.70/strings/ctype-sjis.c 2005-10-07 13:07:21 -07:00 +++ 1.71/strings/ctype-sjis.c 2005-10-07 13:07:21 -07:00 @@ -4563,6 +4563,40 @@ return clen; } +/* + Returns a well formed length of a SJIS string. + CP932 additional characters are also accepted. +*/ +static +uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), + const char *b, const char *e, uint pos) +{ + const char *b0= b; + while (pos && b < e) + { + /* + Cast to int8 for extra safety. + "char" can be unsigned by default + on some platforms. + */ + if (((int8)b[0]) >= 0) + { + /* Single byte character */ + b+= 1; + } + else if (issjishead((uchar)*b) && (e-b)>1 && issjistail((uchar)b[1])) + { + /* Double byte character */ + b+= 2; + } + else + { + /* Wrong byte sequence */ + break; + } + } + return b - b0; +} static MY_COLLATION_HANDLER my_collation_ci_handler = @@ -4586,7 +4620,7 @@ mbcharlen_sjis, my_numchars_mb, my_charpos_mb, - my_well_formed_len_mb, + my_well_formed_len_sjis, my_lengthsp_8bit, my_numcells_sjis, my_mb_wc_sjis, /* mb_wc */
my_well_formed_len_sjisって同じファイルから呼ばれてたのね.どーりで昨日ctype-sjis.c以外ヒットしなかったわけだ。。。