Обсуждение: How strings are sorted by LC_COLLATE specifically?

Поиск
Список
Период
Сортировка

How strings are sorted by LC_COLLATE specifically?

От
Chang Chao
Дата:
Hello Dear All.

How strings are sorted when LC_COLLATE = ja_JP.UTF-8.
I tried to read the documention on that,but there are just a few words,
like LC_COLLATE determines string sort order,
Is there a specific reference about this?
So I can implement an equivalent string sort function in JAVA.
because some of the sort logic is here.
Any clue will be greatly appreciated.

Charles


Re: How strings are sorted by LC_COLLATE specifically?

От
Peter Eisentraut
Дата:
On tor, 2010-11-25 at 14:42 +0900, Chang Chao wrote:
> How strings are sorted when LC_COLLATE = ja_JP.UTF-8.
> I tried to read the documention on that,but there are just a few
> words,
> like LC_COLLATE determines string sort order,
> Is there a specific reference about this?
> So I can implement an equivalent string sort function in JAVA.
> because some of the sort logic is here.

The actual string comparison is done by the strcoll() function in the
operating system's C library.



Re: How strings are sorted by LC_COLLATE specifically?

От
Chang Chao
Дата:
Hi Peter.

When I looked into the source(),came to know that strings are sorted like this.
 int result = strcoll(a, b); if (result == 0) {   result = strcmp(a,b); } return result;


On Wed, Dec 1, 2010 at 4:31 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On tor, 2010-11-25 at 14:42 +0900, Chang Chao wrote:
>> How strings are sorted when LC_COLLATE = ja_JP.UTF-8.
>> I tried to read the documention on that,but there are just a few
>> words,
>> like LC_COLLATE determines string sort order,
>> Is there a specific reference about this?
>> So I can implement an equivalent string sort function in JAVA.
>> because some of the sort logic is here.
>
> The actual string comparison is done by the strcoll() function in the
> operating system's C library.
>
>