Thread: BUG #3323: Wrong charset for the lower and upper functions

BUG #3323: Wrong charset for the lower and upper functions

From
"Eduardo Santos"
Date:
The following bug has been logged online:

Bug reference:      3323
Logged by:          Eduardo Santos
Email address:      eduardo.edusantos@gmail.com
PostgreSQL version: 8.2.4
Operating system:   Windows
Description:        Wrong charset for the lower and upper functions
Details:

When you have the latin character ç and use the lower or the upper
function, instead of return the approprite character, it returns the oposite
one, so the comparisons in the whole DB are wrong. If you have a word such
as Serviço, and you use the lower function, the result is serviÇo, instead
of serviço. the other side is also true: if you use upper in the same eord,
the result is SERVIçO, instead of SERVIÇO.

select upper('Serviço');
Expected result: SERVIÇO
Actual result: SERVIçO

select lower('Serviço');
Expected result: serviço
Actual result: serviÇo

Re: BUG #3323: Wrong charset for the lower and upper functions

From
Euler Taveira de Oliveira
Date:
Eduardo Santos wrote:

> When you have the latin character ç and use the lower or the upper
> function, instead of return the approprite character, it returns the oposite
> one, so the comparisons in the whole DB are wrong. If you have a word such
> as Serviço, and you use the lower function, the result is serviÇo, instead
> of serviço. the other side is also true: if you use upper in the same eord,
> the result is SERVIçO, instead of SERVIÇO.
>
Did you read [1] for issues with code page on Windows console windows?
What kind of encoding are you using? I haven't reproduce your problem here.

[1] http://www.postgresql.org/docs/8.2/static/app-psql.html

--
  Euler Taveira de Oliveira
  http://www.timbira.com/

Re: BUG #3323: Wrong charset for the lower and upper functions

From
"Eduardo Ferreira"
Date:
Hi,

I haven't seen this issue for windows console, but I don't think it affects
my DB. Anyway, I'm using Unicode (UTF8), and this is the only problem I had.
If it had something to do with the encoding, the results would be very
different (such as the wrong character as result for the function).

My guess is that the order is reversed for the =E7 only. I'll try to fix the
windows console issue and tell you the results later. Thanks for your help.

2007/5/30, Euler Taveira de Oliveira <euler@timbira.com>:
>
> Eduardo Santos wrote:
>
> > When you have the latin character =C3=A7 and use the lower or the upper
> > function, instead of return the approprite character, it returns the
> oposite
> > one, so the comparisons in the whole DB are wrong. If you have a word
> such
> > as Servi=C3=A7o, and you use the lower function, the result is servi=C3=
=87o,
> instead
> > of servi=C3=A7o. the other side is also true: if you use upper in the s=
ame
> eord,
> > the result is SERVI=C3=A7O, instead of SERVI=C3=87O.
> >
> Did you read [1] for issues with code page on Windows console windows?
> What kind of encoding are you using? I haven't reproduce your problem
> here.
>
> [1] http://www.postgresql.org/docs/8.2/static/app-psql.html
>
> --
>   Euler Taveira de Oliveira
>   http://www.timbira.com/
>