Skip site navigation (1) Skip section navigation (2)

Re: Solve a problem of LC_TIME of windows.

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>, Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Solve a problem of LC_TIME of windows.
Date: 2009-01-07 13:25:01
Message-ID: 4964AD2D.7060009@hagander.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
ITAGAKI Takahiro wrote:
> Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp> 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


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2009-01-07 13:30:01
Subject: Re: error code 25001
Previous:From: Alvaro HerreraDate: 2009-01-07 13:22:52
Subject: Re: Solve a problem of LC_TIME of windows.

pgsql-patches by date

Next:From: Hiroshi InoueDate: 2009-01-07 16:37:22
Subject: Re: Solve a problem of LC_TIME of windows.
Previous:From: Alvaro HerreraDate: 2009-01-07 13:22:52
Subject: Re: Solve a problem of LC_TIME of windows.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group