Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6608A650174 for ; Wed, 26 Nov 2008 05:30:00 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 95455-04 for ; Wed, 26 Nov 2008 05:29:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 0A8BE650020 for ; Wed, 26 Nov 2008 05:29:56 -0400 (AST) Received: (qmail 29324 invoked by uid 512); 26 Nov 2008 09:29:46 -0000 Received: from unknown (HELO ?127.0.0.1?) (100.0.32.251) by sd2.tpf-fw-c.co.jp with SMTP; 26 Nov 2008 09:29:46 -0000 Message-ID: <492D1707.3060403@tpf.co.jp> Date: Wed, 26 Nov 2008 18:29:43 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: ITAGAKI Takahiro CC: Hiroshi Saito , pgsql-hackers Subject: Re: [PATCHES] Solve a problem of LC_TIME of windows. References: <20081126171019.EFC3.52131E4D@oss.ntt.co.jp> <492D08BF.6090601@tpf.co.jp> <20081126174021.EFC6.52131E4D@oss.ntt.co.jp> In-Reply-To: <20081126174021.EFC6.52131E4D@oss.ntt.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.125 tagged_above=0 required=5 tests=DNS_FROM_RFC_BOGUSMX=2.125 X-Spam-Level: ** X-Archive-Number: 200811/1709 X-Sequence-Number: 128421 ITAGAKI Takahiro wrote: > Hiroshi Inoue 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