Simple Character Sets
Additional character sets may be configured into MySQL if they don’t require multi-byte character support or string collating routines. Adding a character set through configuration requires the following steps:
Add the new character set to the file sql/share/charsets/Index [1]
Create the configuration file for the new character set in sql/share/charsets.
Edit your configure.in file to include the character set in the next compile.
Recompile MySQL.
In this example, we will add a special character set called elvish. We first need to add it to the character set index file. The file looks like this:
$ cat sql/share/charsets/Index
# sql/share/charsets/Index
#
# This file lists all of the available character sets. Please keep this
# file sorted by character set number.
big5 1
czech 2
dec8 3
.
.
.
latin5 30
latin1_de 31To add a new character set, simply add the character set to the end of the file with a unique index:
latin5 30 latin1_de 31 elvish 32
The next step is to create a configuration file in sql/share/charsets for your character set. You can base it on sql/share/charsets/latin1.conf.
$ cd sql/share/charsets $ cp latin1.conf elvish.conf $ vi elvish.conf
There are four
array
definitions in the configuration file. You need to edit each of these
arrays to configure your character set. A # in the
configuration file indicates a comment.
-
ctype The
ctypearray[2] defines the features of each character in the character set. It consists of 257 hexadecimal words. Each ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access