Re: 'order by' does "wrong" with unicode-chars (german umlauts)

From: Richard Huxton <dev(at)archonet(dot)com>
To: peter pilsl <pilsl(at)goldfisch(dot)at>
Cc: PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: 'order by' does "wrong" with unicode-chars (german umlauts)
Date: 2003-09-20 13:25:17
Message-ID: 200309201425.17496.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday 20 September 2003 13:56, peter pilsl wrote:
> > I'm no expert on locales, but I think you're confusing two things.
> > Your character-set determines what symbols you can store.
> > Your locale determines sorting rules. Check the end of the
> > postgresql.conf file for details of what your current settings are.
>
> I dont think that this is my problem.

Sorry - looks like the sorting part of your question threw me off track.

> I get my text from a web-form, process it via perl and store it in
> postgreSQL via DBI-Interface. The unicode-text appears as multibyte in perl
> and I got the suspect that postgresql simply takes this multibyte-text and
> doesnt even reckognize that it could be unicode.

Could be the case - try "show client_encoding" in psql to see what encoding
you are using.

> If I store a german-umlaut-O (uppercase) to postgres and then retrieve it
> using the lower-function on it I dont get a german-umlaut-o (lowercase) at
> all. Only the first byte is converted to lowercase and the second is left
> untouched, while in "real" unicode-lowercasing the first byte would stay
> untouched and the second would change.
> I still dont know how to tell postgres that the data it receives is unicode
> and not just "singlebyte".

If it turns out you want to change encoding to multibyte, I think you'll need
to dump an initdb again. See the chapter on localization - multi-byte
encodings for details.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Fromm 2003-09-20 14:02:28 Re: add constraints to views
Previous Message peter pilsl 2003-09-20 12:56:17 Re: 'order by' does "wrong" with unicode-chars (german umlauts)