There is currently no Esperanto collation in MySQL 4.1, and I suppose
noone is working on that. I need an Esperanto collation so I wrote it
myself, and I successfully added it to MySQL 4.1.14. It compiled
without a problem, and it seems to work as intended.
The code is very simple, so I claim no ownership of it. You're free to
add it to the code and use it as you like. But perhaps it would be
useful to mention my name in the code (similar to the mention of Jody
McIntyre for the Persian collation), in case there are any problems or
requests for improvements.
Here's the code.
Add the following code snippets to "strings/ctype-uca.c":
static const char esperanto[]=
"& C < \\u0109 <<< \\u0108"
"& G < \\u011D <<< \\u011C"
"& H < \\u0125 <<< \\u0124"
"& J < \\u0135 <<< \\u0134"
"& S < \\u015d <<< \\u015c"
"& U < \\u016d <<< \\u016c";
CHARSET_INFO my_charset_ucs2_esperanto_uca_ci=
{
209,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
"ucs2", /* cs name */
"ucs2_esperanto_ci", /* name */
"", /* comment */
esperanto, /* tailoring */
NULL, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
};
CHARSET_INFO my_charset_utf8_esperanto_uca_ci=
{
210,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
"utf8", /* cs name */
"utf8_esperanto_ci", /* name */
"", /* comment */
esperanto, /* tailoring */
ctype_utf8, /* ctype */
NULL, /* to_lower */
NULL, /* to_upper */
NULL, /* sort_order */
NULL, /* contractions */
NULL, /* sort_order_big*/
NULL, /* tab_to_uni */
NULL, /* tab_from_uni */
NULL, /* state_map */
NULL, /* ident_map */
8, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
};
The above collations "my_charset_ucs2_esperanto_uca_ci" and
"my_charset_utf8_esperanto_uca_ci" also have to be added to
"mysys/charset-def.c".
Finally "ucs2_esperanto_ci" and "utf8_esperanto_ci" have to be added
as possible collations in the configure file.
Cheers!
--
Bertil Wennergren <http://bertilow.com>