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

Re: [GENERAL] trouble with to_char('L')

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] trouble with to_char('L')
Date: 2010-04-20 13:23:45
Message-ID: 201004201323.o3KDNjv28954@momjian.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Takahiro Itagaki wrote:
> 
> Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> 
> > > 1. setlocale(LC_CTYPE, lc_monetary)
> > > 2. setlocale(LC_MONETARY, lc_monetary)
> > > 3. lc = localeconv()
> > > 4. pg_do_encoding_conversion(lc->xxx,
> > >      FROM pg_get_encoding_from_locale(lc_monetary),
> > >      TO GetDatabaseEncoding())
> > > 5. Revert LC_CTYPE and LC_MONETARY.
> 
> A patch attached for the above straightforwardly. Does this work?
> Note that #ifdef WIN32 parts in the patch are harmless on other platforms
> even if they are enabled.

I like this patch.  Instead of having special code to convert from the
_current_ locale, you pass the encoding name to our routines.  This does
mean we are bound by supporting only the encodings PG supports, not the
full range of Win32 encodings, but that seems fine.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

In response to

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2010-04-20 13:35:06
Subject: Re: [DOCS] Streaming replication document improvements
Previous:From: Bruce MomjianDate: 2010-04-20 13:10:18
Subject: Re: [GENERAL] trouble with to_char('L')

pgsql-general by date

Next:From: Tom LaneDate: 2010-04-20 13:36:22
Subject: Re: Int64GetDatum
Previous:From: Bruce MomjianDate: 2010-04-20 13:10:18
Subject: Re: [GENERAL] trouble with to_char('L')

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