Oracle 5.0 Reference Manual page 826

Table of Contents

Advertisement

a suffix of
general_ci
default collation, but usually they are different. The default collation should have a
The binary collation should have a
You must assign a unique ID number to each collation, chosen from the range 1 to 254. To find the
maximum of the currently used collation IDs, use this query:
SELECT MAX(ID) FROM INFORMATION_SCHEMA.COLLATIONS;
2. This step depends on whether you are adding a simple or complex character set. A simple
character set requires only a configuration file, whereas a complex character set requires C source
file that defines collation functions, multi-byte functions, or both.
For a simple character set, create a configuration file, MYSET.xml, that describes the character
set properties. Create this file in the
as the basis for this file. The syntax for the file is very simple:
latin1.xml
• Comments are written as ordinary XML comments
• Words within
<map>
• Each word within
• The
array element for the
<map>
elements after that have 256 words. See
• For each collation listed in the
must contain a
MYSET.xml
For a complex character set, create a C source file that describes the character set properties and
defines the support routines necessary to properly perform operations on the character set:
• Create the file
ctype-MYSET.c
files (such as ctype-big5.c) to see what needs to be defined. The arrays in your file must
*.c
have names like ctype_MYSET, to_lower_MYSET, and so on. These correspond to the arrays
for a simple character set. See
• For each
<collation>
Index.xml, the
• If the character set requires string collating functions, see
Support for Complex Character
• If the character set requires multi-byte character support, see
Character Support for Complex Character
3. Modify the configuration information. Use the existing configuration information as a guide to adding
information for MYSYS. The example here assumes that the character set has default and binary
collations, but more lines are needed if
a. Edit mysys/charset-def.c, and "register" the collations for the new character set.
Add these lines to the "declaration" section:
#ifdef
HAVE_CHARSET_MYSET
extern CHARSET_INFO my_charset_MYSET_general_ci;
extern CHARSET_INFO my_charset_MYSET_bin;
#endif
Add these lines to the "registration" section:
#ifdef
HAVE_CHARSET_MYSET
add_compiled_collation(&my_charset_MYSET_general_ci);
Adding a Character Set
(general, case insensitive). It is possible for the binary collation to be the
binary
sql/share/charsets
array elements are separated by arbitrary amounts of whitespace.
array elements must be a number in hexadecimal format.
<map>
<ctype>
<charset>
<collation>
in the
strings
Section 10.3.1, "Character Definition
element listed in the
file must provide an implementation of the collation.
ctype-MYSET.c
Sets".
MYSET
806
flag.
directory. You can use a copy of
(<!-- text
element has 257 words. The other
Section 10.3.1, "Character Definition
element for the character set in Index.xml,
element that defines the character ordering.
directory. Look at one of the existing
element for the character set in
<charset>
Section 10.3.2, "String Collating
Section 10.3.3, "Multi-Byte
Sets".
has additional collations.
primary
-->).
array
<map>
Arrays".
ctype-
Arrays".
flag.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents