Re: Charset Win1250 on Windows and Ubuntu

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Durumdara *EXTERN*" <durumdara(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Charset Win1250 on Windows and Ubuntu
Date: 2009-12-19 22:32:04
Message-ID: D960CB61B694CF459DCFB4B0128514C203A8991A@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Durumdara wrote:
> I have a software that uses Postgresql. This program (and website) developed and working on Window (XP/2003),
> with native charset (win1250).
>
> Prior week we got a special request to install this software to a Linux server.
>
> Yesterday I installed Ubu9.10 on VirtualBox, and tried to moving the database under Linux.
>
> First big problem is that when I tried to create a database with same parameters as in Windows, the PGAdmin
> show an error.
> The errormessage is:
> "Error: new encoding (Win1250) is incompatible with the encoding of the template database (UTF8)."
>
> Ok, I changed to "template0".
>
> Then I got error that Win1250 is not good for collation hu_HU.UTF8.
>
> When I tried to insert hungarian chars (to check sort order), the C and POSIX return wrong result - as I thought before.
>
> The Windows version of PG and Admin is not supports collation, so these two options are disable (collation,
> character type).
>
> But in Linux I have only UTF version that can sort rows in good order.
>
> The problem that the client program is win1250 based, and I must rewrite all things to make same results.
>
> Have anybody some way, some tricky solution for this problem?

If the collation ho_HU.UTF8 is what you want (can sort rows in good order), you
should use UTF8 as database encoding.

If you need the data in WIN1250 on the client side, change the client encoding to WIN1250.

So:
- Create the database with UTF8.
- Change the client encoding to WIN1250 (e.g. by setting the environment variable PGCLIENTENCODING).
- Import the dump of the Windows database. It will be converted to UTF-8.
- Make sure that the client program has client encoding WIN1250.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2009-12-19 22:37:13 Re: Extracting SQL from logs in a usable format
Previous Message Pavel Stehule 2009-12-19 22:27:23 Re: How to call a function that returns a refcursor ?