Adding custom french EBCDIC collation for unicode
Posted by: Sergey Vovnenko
Date: January 22, 2020 09:03AM

Hi everyone,

I have a task to add custom EBCDIC collation with french symbols.
This collation based on https://en.wikipedia.org/wiki/EBCDIC_1047

1)
I've already tried to add custom collation to latin1

add weights map to latin1.xml
<collation name="latin1_ebcdic">
<map>

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 3A 5F 5B 3B 4C 30 5D 2D 3D 3C 2E 4B 40 2B 41
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 5A 3E 2C 5E 4E 4F
5C C1 C2 C3 C4 C5 C6 C7 C8 C9 D1 D2 D3 D4 D5 D6
D7 D8 D9 E2 E3 E4 E5 E6 E7 E8 E9 AD E0 BD 3F 4D
59 61 62 63 64 65 66 67 68 69 71 72 73 74 75 76
77 78 79 A2 A3 A4 A5 A6 A7 A8 A9 C0 2F D0 A1 FF
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
21 AA 2A B1 7F B2 4A B5 BB B4 7A 6A B0 CA AF BC
70 6F EA FA BE A0 B6 B3 7D DA 7B 6B B7 B8 B9 AB
44 44 42 46 43 47 7E 48 54 51 52 53 58 55 56 57
AC 49 ED EE EB EF EC BF 60 FD FE FB FC BA AE 39
24 25 22 26 23 27 7C 28 34 31 32 33 38 35 36 37
6C 29 CD CE CB CF CC E1 50 DD DE DB DC 6D 6E DF
</map>
</collation>

In this approach everything works fine except unicode symbols.
Using this collation they convert to "?" have same weight.
Unicode symbols during sorting put into middle of the list (after "?") instead of end of it.

2)
Also have tried solution (Defining a UCA Collation Using LDML Syntax) described here https://dev.mysql.com/doc/refman/5.7/en/ldml-collation-example.html
Add rules to utf8 charset.
But it seems that <rules> dont support order that I set. It just put symbols in the beginning but not support order that I mentioned in <rules> block:
<rules>
<reset>\u0000</reset>
<i>\u0020</i>
<i>\u00A0</i>
<i>\u00E2</i>
<i>\u00E4</i>
<i>\u00E0</i>
<i>\u00E1</i>
<i>\u00E3</i>
<i>\u00E5</i>
...
</rules>


Maybe someone can give me a hint how to add custom collation based on EBCDIC 1047 with support of unicode symbols (symbols other that EBCDIC 1047 must be put into end with maximum weight).

Thank you in advance!

Options: ReplyQuote


Subject
Views
Written By
Posted
Adding custom french EBCDIC collation for unicode
1191
January 22, 2020 09:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.