Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A4EDC63222C for ; Wed, 7 Jan 2009 09:26:27 -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 19997-04-2 for ; Wed, 7 Jan 2009 09:26:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from svr2.hagander.net (svr2.hagander.net [88.198.128.226]) by mail.postgresql.org (Postfix) with ESMTP id 28E34632265 for ; Wed, 7 Jan 2009 09:25:06 -0400 (AST) Received: from dynamic.hagander.net ([127.0.0.1]) (encrypted and authenticated) by svr2.hagander.net (Postfix) with ESMTP id 9633ADCCFDA; Wed, 7 Jan 2009 14:25:02 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mha-laptop.hagander.net (Postfix) with ESMTP id 1E759124117; Wed, 7 Jan 2009 14:25:02 +0100 (CET) Message-ID: <4964AD2D.7060009@hagander.net> Date: Wed, 07 Jan 2009 14:25:01 +0100 From: Magnus Hagander User-Agent: Thunderbird 2.0.0.18 (X11/20081125) MIME-Version: 1.0 To: ITAGAKI Takahiro CC: Hiroshi Inoue , Hiroshi Saito , pgsql-hackers Subject: Re: Solve a problem of LC_TIME of windows. References: <20081126174021.EFC6.52131E4D@oss.ntt.co.jp> <492D1707.3060403@tpf.co.jp> <20090107140111.810A.52131E4D@oss.ntt.co.jp> In-Reply-To: <20090107140111.810A.52131E4D@oss.ntt.co.jp> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200901/452 X-Sequence-Number: 131096 ITAGAKI Takahiro wrote: > Hiroshi Inoue wrote: > >> Seems LC_CTYPE and LC_TIME should be convertible even though we use >> wcsftime (which internally calls strftime?). > > Ok, wcsftime() requries both LC_TIME and LC_CTYPE are the same setting > (at least encoding) on Windows. > > The attached patch is an updated version to fix cache_locale_time(). > Now it sets LC_TIME and LC_CTYPE to the specified locale and restore > them at end of the function. I tested the patch on Windows XP Japanese > Edition (SJIS) with UTF-8 and EUCJP databases, and worked expectedly. > > "#ifdef WIN32" codes seems to be ugly in the patch, > but I have no other idea... Hmm. Is this actually cleaner than using the original method as suggested? Because if I understand things right, that version did *not* require the setting of LC_CTYPE? (this is the version that uses strftime and does two conversions) //Magnus