Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 859A063268E for ; Fri, 9 Jan 2009 09:05:14 -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 51461-09 for ; Fri, 9 Jan 2009 09:05:10 -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 C11CE632645 for ; Fri, 9 Jan 2009 09:05:07 -0400 (AST) Received: from dynamic.hagander.net ([127.0.0.1]) (encrypted and authenticated) by svr2.hagander.net (Postfix) with ESMTP id B9BFADCD031; Fri, 9 Jan 2009 14:05:04 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mha-laptop.hagander.net (Postfix) with ESMTP id 99C09124117; Fri, 9 Jan 2009 14:05:03 +0100 (CET) Message-ID: <49674B7F.1030307@hagander.net> Date: Fri, 09 Jan 2009 14:05:03 +0100 From: Magnus Hagander User-Agent: Thunderbird 2.0.0.19 (X11/20090105) 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/679 X-Sequence-Number: 131323 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... I have applied this version of the patch (with only a minor further addition to the comment). Thank you all for your work and patience in getting this fixed! Let's hope it stays fixed :-) //Magnus