BUG #2193: INITCAP and LOWER/UPPER string conversion error

Started by Andras Gotabout 20 years ago3 messagesbugs
Jump to latest
#1Andras Got
andrej1981@gmail.com

The following bug has been logged online:

Bug reference: 2193
Logged by: Andras Got
Email address: andrej1981@gmail.com
PostgreSQL version: 8.0.4, 8.1.1
Operating system: FreeBSD and Linux
Description: INITCAP and LOWER/UPPER string conversion error
Details:

Hi,

8.0.4
I'm trying to select with LOWER/UPPER and INITCAP but they return bad values
after hungarian accentuated letters (e.g: é á ű ú ő ó ü). The bad is
value is a capital letter. This makes almost impossible to compare strings
from an input with ones in the table. Also LOWER returns a big capital
letter for the first letter of the word. UPPER doesn't really converts some
chars to uppercase, e.g: ó, á, é.

I'd like to something like this with PHP:
"SELECT id FROM table WHERE LOWER(name) = '".strtolower($name)."';

I tried with LATIN2 encoding and the same happened.

8.1.1
The first capital letter probleml looks like to be solved, but the
accentuated letter problem still exists.

Thank you for your time,
Andrej

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andras Got (#1)
Re: BUG #2193: INITCAP and LOWER/UPPER string conversion error

"Andras Got" <andrej1981@gmail.com> writes:

I'm trying to select with LOWER/UPPER and INITCAP but they return bad values
after hungarian accentuated letters (e.g: é á ű
ú ő ó ü).

Are you sure you are using the right locale and database encoding?
If so, what are they?

There are some locale-related fixes in the latest releases (8.0.6
and 8.1.2), though I'm not sure if they address your problem.

regards, tom lane

#3Andras Got
andrej@antiszoc.hu
In reply to: Tom Lane (#2)
Re: BUG #2193: INITCAP and LOWER/UPPER string conversion error

I solved this, this was a local issue. I tried to cancel my letter, but noone bothered with the
cancelling mail. :)

Yes this was a locale mixup. Sorry.

Regards,
Andrej

Tom Lane írta:

Show quoted text

"Andras Got" <andrej1981@gmail.com> writes:

I'm trying to select with LOWER/UPPER and INITCAP but they return bad values
after hungarian accentuated letters (e.g: é á ű
ú ő ó ü).

Are you sure you are using the right locale and database encoding?
If so, what are they?

There are some locale-related fixes in the latest releases (8.0.6
and 8.1.2), though I'm not sure if they address your problem.

regards, tom lane