Re: [pgsql-hackers-win32] UNICODE/UTF-8 on win32

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers-win32(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [pgsql-hackers-win32] UNICODE/UTF-8 on win32
Date: 2005-02-24 23:45:57
Message-ID: 200502242345.j1ONjv627317@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32

Magnus Hagander wrote:
> The installer does not permit it, but initdb lets you do anything yuo
> want - I think that's where we are. If you know what you're doing, you
> can use it by manually initdbing.
>
> There is no such thing as "unicode locale". Unicode (UTF8) is an
> encoding, that has to be paired with a locale. I assume you mean C
> locale.

Oh, sorry. So there is no ordering in Unicode? No wonder some
languages can't use Unicode effectively. I can see why ordering is
meaningless for creating a document that is just displayed but important
for a database.

I have added the last sentence to the TODO list:

o Disallow encodings like UTF8 which PostgreSQL supports
but the operating system does not (already disallowed by
pginstaller)

To fix UTF8, the data needs to be converted to UTF16 and then
the Win32 wcscoll() can be used, and perhaps other functions
like towupper(). However, UTF8 already works with normal
locales but provides no ordering.

>
> While UPPER/LOWER does not matter, sort order does - for indexes if
> nothing else. I'm unsure if this works - I think I read reports about
> itn ot working, but I haven't tried it out myself.

I assume C just compares the bytes, meaning equality comparisons are
fine, but greater/less than is consistent but meaningless.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-02-24 23:56:55 Re: psql: recall previous command?
Previous Message Gavin Sherry 2005-02-24 23:23:31 Re: Where are we on stored procedures?

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message John Hansen 2005-02-25 00:02:56 Re: [pgsql-hackers-win32] UNICODE/UTF-8 on win32
Previous Message Bruce Momjian 2005-02-24 22:28:44 Re: [PATCHES] [pgsql-hackers-win32] Repleacement for src/port/snprintf.c