diff options
author | unknown <mkindahl@dl145h.mysql.com> | 2007-11-21 21:15:33 +0100 |
---|---|---|
committer | unknown <mkindahl@dl145h.mysql.com> | 2007-11-21 21:15:33 +0100 |
commit | 692f0e4f67ee3a3e4e28b92074cd9872ab3ed644 (patch) | |
tree | 7eebc171f167cc46df49668d69760ac4e7a73137 /strings | |
parent | 1fb0a096cf9ca930fe9bc66b202c8662daa76a9a (diff) | |
parent | 47d30b190dd8ca35d035683ce6fba58d9f4688e0 (diff) | |
download | mariadb-git-692f0e4f67ee3a3e4e28b92074cd9872ab3ed644.tar.gz |
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
client/mysql.cc:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/mysql.result:
Auto merged
mysql-test/suite/ndb/r/ndb_dd_basic.result:
Auto merged
mysql-test/suite/rpl/r/rpl_extraCol_innodb.result:
Auto merged
mysql-test/suite/rpl/r/rpl_extraCol_myisam.result:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
Auto merged
mysql-test/t/ctype_uca.test:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/innodb.result:
Manual merge.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-euc_kr.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index fd783015bf4..247fb041896 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -179,20 +179,40 @@ static uchar NEAR sort_order_euc_kr[]= /* Support for Korean(EUC_KR) characters, by powerm90@tinc.co.kr and mrpark@tinc.co.kr */ -#define iseuc_kr(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)) +/* + Unicode mapping is done according to: + ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/KSC/KSC5601.TXT + + Valid multi-byte characters: + + [A1..FE][41..5A,61..7A,81..FE] + + Note, 0x5C is not a valid MB tail, + so escape_with_backslash_is_dangerous is not set. +*/ + +#define iseuc_kr_head(c) ((0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)) + +#define iseuc_kr_tail1(c) ((uchar) (c) >= 0x41 && (uchar) (c) <= 0x5A) +#define iseuc_kr_tail2(c) ((uchar) (c) >= 0x61 && (uchar) (c) <= 0x7A) +#define iseuc_kr_tail3(c) ((uchar) (c) >= 0x81 && (uchar) (c) <= 0xFE) + +#define iseuc_kr_tail(c) (iseuc_kr_tail1(c) || \ + iseuc_kr_tail2(c) || \ + iseuc_kr_tail3(c)) static uint ismbchar_euc_kr(CHARSET_INFO *cs __attribute__((unused)), const char* p, const char *e) { return ((*(uchar*)(p)<0x80)? 0:\ - iseuc_kr(*(p)) && (e)-(p)>1 && iseuc_kr(*((p)+1))? 2:\ + iseuc_kr_head(*(p)) && (e)-(p)>1 && iseuc_kr_tail(*((p)+1))? 2:\ 0); } static uint mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c) { - return (iseuc_kr(c) ? 2 : 1); + return (iseuc_kr_head(c) ? 2 : 1); } @@ -8654,7 +8674,7 @@ my_well_formed_len_euckr(CHARSET_INFO *cs __attribute__((unused)), /* Single byte ascii character */ b++; } - else if (b < emb && iseuc_kr(*b) && iseuc_kr(b[1])) + else if (b < emb && iseuc_kr_head(*b) && iseuc_kr_tail(b[1])) { /* Double byte character */ b+= 2; |