[Mono-devel-list] The first (attempt to checkin) managed collation patch

Atsushi Eno atsushi at ximian.com
Wed Jul 20 13:32:12 EDT 2005

I forgot to mention what this patch fixes, on String.cs and

String.cs : The length of compared string might not be equal
to another one, so we should not use the length of "value"
in IsPrefix().

CompareInfo.cs : It switches between managed collation and
unmanaged one (not working now). I also removed some "short cuts"
are invalid when it comes to real collation.

Also, in Makefile I replaced SortKey.cs with new one, for
managed collation support.

Atsushi Eno

Atsushi Eno wrote:
> Hello,
> I think it could be the time to merge my managed collation patch
> that enables Windows like collation at managed code side.
> ** The changes I want to make
> The attached patch. Actually it is already in svn:
> mcs/class/corlib/Mono.Globalization.Unicode/managed-collation.patch
> But besides the patch, I need to checkin 7 prebuilt binary resource
> files in mcs/class/corlib directory, though they can be built when
> you run "make" in mcs/class/corlib/Mono.Globalization.Unicode. [*1]
> I put all the binaries here:
> http://monkey.workarea.jp/tmp/20050720
> ** How it affects on mono
> It still does not enable managed collation unless you explicitly
> set environment variable MONO_USE_MANAGED_COLLATION=yes.
> I can build mcs with this managed collation mode and all corlib
> tests pass (I guess other tests as well).
> When this managed collation is enabled, it will eat huge managed
> resource (and will make you sad when you run mono --profile ;-).
> I can make this into unmanaged header file if we want.
> Also, currently managed collation is extremely *slow* since it
> lacks a significant optimization, to just compare codepoints
> as long as possible (safe character comparison).
> ** How it is stable
> It is not stable yet, but most of the expected changes are 1)sortkey
> table fixes, 2) culture-dependent tailoring data, and 3)optimization.
> It still does not work fine on Latin, Greek, Cyrillic and Arabic
> (mostly, on those characters with diacritical mark).
> There are already a couple of working managed collation tests that
> do not run unless the environment variable is set.
> This fixes bug #69771, #70478, #71111, #73417 i.e. all reported
> collation bugs (for #69771 Microsoft's sample code is buggy though).
> Would there be any problem if I commit this patch? Comments are
> welcome.
> ----
> [*1] I don't think it can be incorporated in the build step since
> 1) it requires some downloads like locale-builder, 2) the table
> generation is so slow, and 3) sometimes it might generate broken
> table because the binary resource generator is also written in C#
> and it's not always ordinal (I should sanitize the code at some
> stage when it became stable though).
> Atsushi Eno

More information about the Mono-devel-list mailing list