Re: initdb failes on Traditional chinese machine when postgres install directory contains chinese characters.

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: "Sarkar, Sudipta" <Sudipta_Sarkar(at)bmc(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: initdb failes on Traditional chinese machine when postgres install directory contains chinese characters.
Date: 2010-01-26 13:21:05
Message-ID: 4B5EEC41.5030806@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 23/01/2010 5:19 AM, Sarkar, Sudipta wrote:
> Hi,
>
> I downloaded postgres 8.4 in zip format and installed it under
> c:\postgres用名 on a traditional Chinese windows 2003 server. Note the
> Chinese characters in the folder name. Then I tried to create a database
> using initdb. I specified the following command:
>
> initdb.exe --encoding UTF-8 -D c:\mydb\db --username user1 W L
> c:\postgres用名\share

Hi

I'd like to try to reproduce this issue, but as I don't have a Chinese
localized Windows install I can't use the appropriate characters on the
console.

Is there any way you know of to switch Windows' locale in a cmd.exe
(console) window so you can use other locale's charsets? What is the
name of the encoding Windows uses on your system? I know how to do all
this stuff in Linux, but everything language/locale related seems to be
painfully hard, expensive, and complicated under Windows.

Windows (except Vista Ultimate and 7 Ultimate) doesn't offer the option
to change languages for the system (MUI) and the language interface
packs (LIP) only work on top of a particular base language and don't
support major languages. I can't really install a Chinese windows VM, as
I *really* don't have the language skills to navigate around it and test
with it.

Anyway, what I expect is happening here is that initdb is assuming that
the path is in the database system encoding, where it's actually in the
system's native encoding. If you're using a path that is valid in both
encodings (ie each byte means the same thing) then you get away with it,
which is why ASCII works.

Most likely initdb needs to set client_encoding at some point where it's
forgetting to.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2010-01-26 13:21:45 Re: Postgres Host
Previous Message S Arvind 2010-01-26 13:01:59 Postgres Host