diff options
author | unknown <bar@mysql.com> | 2005-12-12 21:42:09 +0400 |
---|---|---|
committer | unknown <bar@mysql.com> | 2005-12-12 21:42:09 +0400 |
commit | a464e01713d19d358eb7feab2cfdf88bb274d5df (patch) | |
tree | 6c15cf077b53c2157ad83b68ecbe604863e5aabf /include | |
parent | 5aeb69296a4e134f0215da3e6bcce4956b7d76ad (diff) | |
download | mariadb-git-a464e01713d19d358eb7feab2cfdf88bb274d5df.tar.gz |
Bug#15375 Unassigned multibyte codes are broken
into parts when converting to Unicode.
m_ctype.h:
Reorganizing mb_wc return codes to be able
to return "an unassigned N-byte-long character".
sql_string.cc:
Adding code to detect and properly handle
unassigned characters (i.e. the those character
which are correctly formed according to the
character specifications, but don't have Unicode
mapping).
Many files:
Fixing conversion function to return new codes.
ctype_ujis.test, ctype_gbk.test, ctype_big5.test:
Adding a test case.
ctype_ujis.result, ctype_gbk.result, ctype_big5.result:
Fixing results accordingly.
include/m_ctype.h:
Reorganizing mb_wc return codes to be able
to return "an unassigned N-byte long character".
Bug#15375 Unassigned multibyte codes are broken into parts when converting to Unicode.
mysql-test/r/ctype_big5.result:
Fixing results accordingly.
mysql-test/r/ctype_gbk.result:
Fixing results accordingly.
mysql-test/r/ctype_ujis.result:
Fixing results accordingly.
mysql-test/t/ctype_big5.test:
Adding a test case.
mysql-test/t/ctype_gbk.test:
Adding a test case.
mysql-test/t/ctype_ujis.test:
Adding a test case.
sql/sql_string.cc:
Adding code to detect and properly hanlde
unassigned characters (i.e. the those character
which are correctly formed according to the
character specifications, but don't have Unicode
mapping).
strings/ctype-big5.c:
Fixing conversion function to return new codes.
strings/ctype-bin.c:
Fixing conversion function to return new codes.
strings/ctype-cp932.c:
Fixing conversion function to return new codes.
strings/ctype-euc_kr.c:
Fixing conversion function to return new codes.
strings/ctype-gb2312.c:
Fixing conversion function to return new codes.
strings/ctype-gbk.c:
Fixing conversion function to return new codes.
strings/ctype-latin1.c:
Fixing conversion function to return new codes.
strings/ctype-simple.c:
Fixing conversion function to return new codes.
strings/ctype-sjis.c:
Fixing conversion function to return new codes.
strings/ctype-tis620.c:
Fixing conversion function to return new codes.
strings/ctype-ucs2.c:
Fixing conversion function to return new codes.
strings/ctype-ujis.c:
Fixing conversion function to return new codes.
strings/ctype-utf8.c:
Fixing conversion function to return new codes.
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index a5dc7cc00c6..a6ffbaa713f 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -44,10 +44,19 @@ typedef struct unicase_info_st uint16 sort; } MY_UNICASE_INFO; -#define MY_CS_ILSEQ 0 -#define MY_CS_ILUNI 0 -#define MY_CS_TOOSMALL -1 -#define MY_CS_TOOFEW(n) (-1-(n)) + +/* wm_wc and wc_mb return codes */ +#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ +#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */ +#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */ +#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */ +#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */ +/* These following three are currently not really used */ +#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */ +#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */ +#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */ +/* A helper macros for "need at least n bytes" */ +#define MY_CS_TOOSMALLN(n) (-100-(n)) #define MY_SEQ_INTTAIL 1 #define MY_SEQ_SPACES 2 |