String Collating Support For Complex Character Sets; Multi-Byte Character Support For Complex Character Sets; Adding A Collation To A Character Set - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

#define _MY_SPC 010
#define _MY_PNT 020
#define _MY_CTR 040
#define _MY_B
#define _MY_X
The
<ctype>
describe the character. For example,
digit (_MY_X), so its
ctype['A'+1] = _MY_U | _MY_X = 01 | 0200 = 0201
The bitmask values in
MYSET.xml
The
<lower>
each member of the character set. For example:
lower['A'] should contain 'a'
upper['a'] should contain 'A'
Each
<collation>
purposes. MySQL sorts characters based on the values of this information. In some cases, this is
the same as the
sorting rules (for complex character sets), see the discussion of string collating in
"String Collating Support for Complex Character

10.3.2. String Collating Support for Complex Character Sets

For a simple character set named MYSET, sorting rules are specified in the
file using
<map>
are too complex to be handled with simple arrays, you must define string collating functions in the
ctype-MYSET.c
The existing character sets provide the best documentation and examples to show how these functions
are implemented. Look at the
big5, czech, gbk, sjis, and
structures to see how they are used. See also the
for additional information.

10.3.3. Multi-Byte Character Support for Complex Character Sets

If you want to add support for a new character set named
you must use multi-byte character functions in the
directory.
The existing character sets provide the best documentation and examples to show how these functions
are implemented. Look at the
euc_kr, gb2312, gbk, sjis, and
structures to see how they are used. See also the
for additional information.

10.4. Adding a Collation to a Character Set

A collation is a set of rules that defines how to compare and sort character strings. Each collation in
MySQL belongs to a single character set. Every character set has at least one collation, and most have
two or more collations.
A collation orders characters based on weights. Each character in a character set maps to a weight.
Characters with equal weights compare as equal, and characters with unequal weights compare
according to the relative magnitude of their weights.
String Collating Support for Complex Character Sets
/* Spacing character */
/* Punctuation */
/* Control character */
0100
/* Blank */
0200
/* heXadecimal digit */
value for a given character should be the union of the applicable bitmask values that
value should be defined like this:
ctype
m_ctype.h
should be written as hexadecimal values.
and
arrays hold the lowercase and uppercase characters corresponding to
<upper>
array indicates how characters should be ordered for comparison and sorting
array, which means that sorting is case-insensitive. For more complicated
<upper>
array elements within
source file in the
ctype-*.c
tis160
ctype-*.c
ujis
is an uppercase character (_MY_U) as well as a hexadecimal
'A'
are octal values, but the elements of the
Sets".
elements. If the sorting rules for your language
<collation>
directory.
strings
files in the
strings
character sets. Take a look at the
CHARSET_INFO.txt
ctype-MYSET.c
files in the
strings
character sets. Take a look at the
CHARSET_INFO.txt
808
<ctype>
MYSET.xml
directory, such as the files for the
MY_COLLATION_HANDLER
file in the
that includes multi-byte characters,
MYSET
source file in the
directory, such as the files for the
MY_CHARSET_HANDLER
file in the
array in
Section 10.3.2,
configuration
directory
strings
strings
directory
strings

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents