On Sun, 4 Jul 2004, Peter Cruickshank wrote:

> On Sat, 3 Jul 2004 16:13:02 -0400
> Behdad Esfahbod <[EMAIL PROTECTED]> wrote:
>
> > Actually there's a middle solution here, which the price is just
> > messing a bit with your database schema.  All you need is to
> > store the string returned by strxfrm(str) in your database as a
> > binary field, and just sort on that column instead of str.
> >
> > behdad
>
> That might work for Ehsan, but it sadly wouldn't save much effort for us
> since PHP doesn't do Persian UTF-8 collation (that I've been able to get
> working anyway), or provide access to strxfrm()

To do Persian collation you need to set locale to Persian.
Wrapping setlocale and strxfrm is a ten minute job (if they're
really not in PHP).  Or do you mean you are using PHP on a system
which does Persian collation but does not provide strxfrm?  Then
you better deal with it...  If you have Glibc, as I said, it's a
ten minute job.

> :-(
>
> - which is why MySql seemed the least bad option.

By no means it's the least bad option, believe me.  It's the
hardest, without Gilbc at least.

> Peter

[Ehsan, you just replied to me.  Answering on list.]

On Sun, 4 Jul 2004, Ehsan Akhgari wrote:

> > Actually there's a middle solution here, which the price is
> > just messing a bit with your database schema.  All you need
> > is to store the string returned by strxfrm(str) in your
> > database as a binary field, and just sort on that column
> > instead of str.
>
> Thanks for the suggestion.  I didn't think of this before.
>
> BTW, is there a free Persian collation implementation available?  I have

Well, you may wish to read a couple documents.  Read Unicode
Collation Algorithm for example.  Just read the intro or
something like that.  The point is that Persian Collation is only
an small table feed to the Unicode Collation Algorithm.  So yes,
there is a free Persian collation implementation, Glibc + fa_IR
locale.

> seen Roozbeh's fa_IR LC_COLLATE file, but I'm wonderring is it implemented
> in straight C as well.  And no, using glibc is not an option here.

What you have seen is the binary encoded table.  The source is in
the fa_IR locale source file.

> Thanks!
>
> -------------
> Ehsan Akhgari

Guys, both of you, if you don't have Glib, and your system does
not provide what you need, you:

* Either forget about Persian Collation, or
* Implement your own minimal collation, or
* Consider using something like Glibc or uClibc with Persian
  locale as a library.  Not sure how uClibc deals with Persian
  locale.

--behdad
  behdad.org
_______________________________________________
PersianComputing mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/persiancomputing

Reply via email to