Re: [PATCHES] Solve a problem of LC_TIME of windows.

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Solve a problem of LC_TIME of windows.
Date: 2008-11-26 09:29:43
Message-ID: 492D1707.3060403@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

ITAGAKI Takahiro wrote:
> Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp> wrote:
>
>> Please call setlocale(LC_CTYPE/LC_ALL, "") first.
>
> Ah, it works! But setlocale(*, "") means that we always use platform
> locale (Japanese and SJIS in Japan).

Maybe you can call setlocale(LC_CTYPE, ".20932") instead and you
would get CP20932 encoding. The encoding of LC_TIME or LC_MESSAGES
has little meaning.

> It could be different from server
> encoding and locale in postgres. Is it acceptable? I think we need to
> set LC_CTYPE and other LC_* independently...

Seems LC_CTYPE and LC_TIME should be convertible even though we use
wcsftime (which internally calls strftime?).
As for gettext(LC_MESSAGES) on Windows we can set LC_CTYPE independently
because it is unrelated to the output encoding. In addition we can call
bind_textdomain_codeset to change the output encoding.
I'm providing a patch to adjust the output encoding of Windows
gettext.

regards,
Hiroshi Inoue

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2008-11-26 09:54:01 Re: WIP: Automatic view update rules
Previous Message Richard Huxton 2008-11-26 09:21:49 Re: Enhancement to pg_dump

Browse pgsql-patches by date

  From Date Subject
Next Message Jaime Casanova 2008-11-26 21:35:23 Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1
Previous Message ITAGAKI Takahiro 2008-11-26 08:51:08 Re: [PATCHES] Solve a problem of LC_TIME of windows.