Re: pgsql: setlocale() on Windows doesn't work correctly if the locale name

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: setlocale() on Windows doesn't work correctly if the locale name
Date: 2011-04-19 23:59:10
Message-ID: 4DAE21CE.8030402@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

(2011/04/16 2:56), Heikki Linnakangas wrote:
> setlocale() on Windows doesn't work correctly if the locale name contains
> apostrophes or dots.

As for apostrophes, isn't the cause that initdb loses the single quote
of locale? ([BUGS] BUG #5818: initdb lose the single quote of locale)

As the bug reporter mentions, initdb loses the single quote in reality.
Concretely speaking, scanstr() called from bootscanner.l loses it.
I'm not sure if it's suitable for the bootstrap code to call scanstr().

regards,
Hiroshi Inoue

> There isn't much hope of Microsoft fixing it any time
> soon, it's been like that for ages, so we better work around it. So, map a
> few common Windows locale names known to cause problems to aliases that work.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/pg/commitdiff/d5a7bf8c11c8b66c822bbb1a6c90e1a14425bd6e
>
> Modified Files
> --------------
> src/bin/initdb/initdb.c | 89 +++++++++++++++++++++++++++++++++++++++++++----
> 1 files changed, 82 insertions(+), 7 deletions(-)

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-04-20 00:22:23 Re: [HACKERS] Re: pgsql: setlocale() on Windows doesn't work correctly if the locale name
Previous Message Bruce Momjian 2011-04-19 23:15:14 pgsql: Add C comment

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-04-20 00:20:46 Re: getting to beta
Previous Message Jeff Janes 2011-04-19 23:29:08 Re: pgbench \for or similar loop