Thread: LC_COLLATE UTF-8 Locales on Windows?

LC_COLLATE UTF-8 Locales on Windows?

From
William Rose
Date:
Hello,

I'm developing an offline web app targeted for the Windows platform,
using Postgres. Recently our client has added the requirement of Arabic
support for use in Saudi Arabia. We're trying to keep everything on
UTF-8, but when it comes to collation, the only Arabic-specific locale
is for WIN1256 rather than UTF-8. Is there a way to get Arabic sorting
in UTF-8 on Windows?

We can't go to an Arabic-only encoding on our database because we need
to be able to support any and all languages within the same database, or
even in the same table (e.g. each row has columns for English
translation, French, Arabic, etc).

William Rose
TerraFrame

Re: LC_COLLATE UTF-8 Locales on Windows?

From
wdrose
Date:
Ok, I finally found the solution for this. Posting what worked for me, for
posterity. For some reason,

select name collate "Arabic_Saudi Arabia.1256" from forms order by name asc;

doesn't work. But if I do

create collation arabic (locale='Arabic_Saudi Arabia.1256');

and then

select name collate "arabic" from forms order by name asc;

it works and allows me to collate UTF-8 by any locale, as mentioned in the
PostgreSQL documentation.

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/LC-COLLATE-UTF-8-Locales-on-Windows-tp5104187p5106571.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

Re: LC_COLLATE UTF-8 Locales on Windows?

From
"Jean-Yves F. Barbier"
Date:
On Wed, 28 Dec 2011 17:57:22 -0800 (PST)
wdrose <wrose@terraframe.com> wrote:

> create collation arabic (locale='Arabic_Saudi Arabia.1256');
>
> and then
>
> select name collate "arabic" from forms order by name asc;
>
> it works and allows me to collate UTF-8 by any locale, as mentioned in the
> PostgreSQL documentation.

Thanks for the return.
--
When taxes are due, Americans tend to feel quite bled-white and blue.