larryk has asked for the wisdom of the Perl Monks concerning the following question:
Bit of an oddball query, this one... but I bet someone knows one or two ways to do it.
I'm creating search indexes with Perl for my Chinese dictionary mobile app and am hitting a problem where the (Perl) sorted keys - Chinese characters - are not in exactly the same order as the binary search on-device is expecting them to be.
In real terms, there are 165910 index records and 188 of them are unreachable on-device because the sort order is slightly different between Perl's standard string sort and C#'s String.Compare function (with "en-US" culture).
I've played around for weeks with the culture settings and this 188 unreachable number is the optimal result I have achieved. So 2 questions:
1. (long shot) has anyone seen this issue before so knows the magic incantation to get Perl and C# to agree 100% on sort order for UTF-8?
2. (failing that) how do I get Perl to sort by Unicode code point (i.e. the raw underlying \u{xxxx} value, because I can probably force C# to do it that way as an exception for this index?
Any help much appreciated.
larryk perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: sorting Chinese characters
by choroba (Cardinal) on Feb 01, 2013 at 10:28 UTC | |
by larryk (Friar) on Feb 02, 2013 at 03:28 UTC | |
by choroba (Cardinal) on Feb 02, 2013 at 09:31 UTC | |
by larryk (Friar) on Feb 12, 2013 at 05:31 UTC | |
Re: sorting Chinese characters
by Anonymous Monk on Feb 01, 2013 at 10:41 UTC | |
Re: sorting Chinese characters
by punch_card_don (Curate) on Feb 01, 2013 at 13:39 UTC | |
by larryk (Friar) on Feb 02, 2013 at 04:00 UTC |