By default, MySQL will use the ISO8859-1 (Latin1) character set. This is the character set used in the USA and western Europe.
The character set decides what characters are allowed in names and how
things are sorted by the ORDER BY and GROUP BY commands.
You may change this at compile time by the configure switch
--with-charset=charset. See section Quick installation overview..
If you want to add another character set to MySQL you must:
mysql_source_directory/strings/ctype-$CHARSET_NAME.c.
to_lower['A'] should contain 'a' to_upper['a'] should contain 'A'sort_order[] is a map of how characters should be sorted. For many sets this is the same as to_upper (case insensitive sorts). MySQL will sort characters based on the value of sort_order[character]. ctype[] is a array of bits that describes each character. You can find the following definitions in m_ctype.h:
#define _U 01 /* Upper case */ #define _L 02 /* Lower case */ #define _N 04 /* Numeral (digit) */ #define _S 010 /* Spacing character */ #define _P 020 /* Punctuation */ #define _C 040 /* Control character */ #define _B 0100 /* Blank */ #define _X 0200 /* heXadecimal digit */For example ctype['A'] should contain the value:
_U + _X = 0201
CHARSETS_AVAILABLE list in
configure.in
If you are making a multiple-character char set, you can use the _MB macros. In `strings/m_ctype.h.in' add:
#define MY_CHARSET_<C> X #if MY_CHARSET_CURRENT == MY_CHARSET_<C> #define USE_MB #define USE_MB_IDENT #define ismbchar(p, end) (...) #define ismbhead(c) (...) #define mbcharlen(c) (...) #define MBMAXLEN N #endif
| MY_CHARSET_<C> | unique value. |
| USE_MB | This charset have mb-char. |
| USE_MB_IDENT: | Use mb-char as identifier. (optional) |
| ismbchar(p, e) | return 0 if not mb-char, or size of char if mb-char. Check from (char*)p to (char*)e-1. |
| ismbhead(c) | Is c first char of mb or not? |
| mbcharlen(c) | Size of char if c is first char of mb. |
| MBMAXLEN | Maximum size of one character. |
Go to the first, previous, next, last section, table of contents.