Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Gevik Babakhani <pgdev(at)xs4all(dot)nl>
Cc: "'Magnus Hagander'" <magnus(at)hagander(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)
Date: 2008-02-14 22:35:42
Message-ID: 20080214223542.GC15085@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Gevik Babakhani wrote:

> gevik=# set lc_messages to 'Spanish_Spain';
> SET
> gevik=# select to_char((current_date + s.a),'TMDay TMMonth YYYY') as dates from generate_series(0,6) as s(a);
> dates
> -----------------------
> Jueves Febrero 2008
> Viernes Febrero 2008
> Sbado Febrero 2008
> Domingo Febrero 2008
> Lunes Febrero 2008
> Martes Febrero 2008
> Mircoles Febrero 2008
> (7 rows)

Hmm, interestingly you lost the diacritics here. The output is mangled
for Saturday and Wednesday, which should read "Sábado" and "Miércoles"
respectively.

It is not good that the system allows you to output invalidly encoded
data. What happens if you try setting lc_messages to
Spanish_Spain.65001 instead?

Ideally, it should be an error to set lc_messages to a value that's not
compatible with the current encoding. Do we do that currently elsewhere?

(Perhaps this is not a problem with your patch, but rather a problem
that's worth fixing separately.)

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-02-14 22:39:54 Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)
Previous Message Alvaro Herrera 2008-02-14 22:28:18 Re: Show INHERIT in \du