Foreign language sorting

View: New views
3 Messages — Rating Filter:   Alert me  

Foreign language sorting

by Naz Gassiep :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am looking for a method to sort an array of strings, however the
strings are UTF8 and contain latin and non-latin characters. Is there a
method to sort a string such that letters such as e with an acute are
grouped with e without an acute, or even for strings that are made up
entirely of Thai or Cyrillic characters?
I really hope I don't have to roll my own sorting algorithm.
Thanks,
- Naz.

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: Foreign language sorting

by Jerry Schwartz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm just an ignorant lurker, but different foreign languages have different
rules. I don't think a single scheme will work even for all European
languages, let alone Chinese (about which I know nothing) or Thai (about
which I know less). This was discussed in the context of MySQL sorting
Hungarian, and the response was that Hungarian has two distinct collating
sequences.

Regards,

Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com

> -----Original Message-----
> From: Naz Gassiep [mailto:naz@...]
> Sent: Wednesday, January 16, 2008 9:23 AM
> To: php-i18n@...
> Subject: [PHP-I18N] Foreign language sorting
>
> I am looking for a method to sort an array of strings, however the
> strings are UTF8 and contain latin and non-latin characters. Is there a
> method to sort a string such that letters such as e with an acute are
> grouped with e without an acute, or even for strings that are made up
> entirely of Thai or Cyrillic characters?
> I really hope I don't have to roll my own sorting algorithm.
> Thanks,
> - Naz.
>
> --
> PHP Unicode & I18N Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Foreign language sorting

by Tomas Kuliavas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I am looking for a method to sort an array of strings, however the
> strings are UTF8 and contain latin and non-latin characters. Is there a
> method to sort a string such that letters such as e with an acute are
> grouped with e without an acute, or even for strings that are made up
> entirely of Thai or Cyrillic characters?
> I really hope I don't have to roll my own sorting algorithm.

See http://pecl.php.net/package/intl and
http://docs.php.net/manual/en/book.intl.php

--
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php