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

From Bruce Momjian
Subject Re: [pgsql-hackers-win32] UNICODE/UTF-8 on win32
Date
Msg-id 200502242345.j1ONjv627317@candle.pha.pa.us
Whole thread Raw
In response to Re: [pgsql-hackers-win32] UNICODE/UTF-8 on win32  ("Magnus Hagander" <mha@sollentuna.net>)
Responses Re: [pgsql-hackers-win32] UNICODE/UTF-8 on win32  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: Where are we on stored procedures?
Next
From: Bruce Momjian
Date:
Subject: Re: psql: recall previous command?