Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!) - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)
Date
Msg-id 20080214223542.GC15085@alvh.no-ip.org
Whole thread Raw
In response to Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)  ("Gevik Babakhani" <pgdev@xs4all.nl>)
Responses Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)
Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVCstrikes back!)
List 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.

pgsql-patches by date:

Previous
From: "Gevik Babakhani"
Date:
Subject: Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)
Next
From: Tom Lane
Date:
Subject: Re: Fix for 8.3 MSVC locale (Was [HACKERS] NLS on MSVC strikes back!)