LATIN2 and wrong upper() and lower() functions output

Started by Robert Gaszewskiabout 25 years ago2 messagesbugs
Jump to latest
#1Robert Gaszewski
graszew@poland.com

I have PostgreSQL 7.1RC1 with multibyte support and encoding
set to LATIN2.

When I try SELECT UPPER('some_text_with_polish_national_chars');
polish chars are still in lower case but others (abcd...wxyz) are
in upper case.

For example:

(Client encoding is LATIN2)

input:
SELECT UPPER('��ka'); --'�' and '�' are polish national chars

output:

upper
-------
��KA

but it should be:

upper
-------
��KA

Also, ORDER BY works improperly.

for example:

input:
CREATE TABLE test ( name varchar(20) );

INSERT INTO test VALUES('ad');
INSERT INTO test VALUES('aa');
INSERT INTO test VALUES('ac');
INSERT INTO test VALUES('ab');
INSERT INTO test VALUES('aďż˝'); --'ďż˝' is another polish national char
INSERT INTO test VALUES('ae');

SELECT * FROM test ORDER BY name;

output:

name
------
aa
ab
ac
ad
ae
aďż˝

but output should be:

name
------
aa
ab
ac
aďż˝
ad
ae

PS.
I compiled PostgreSQL with --enable-multibyte and
--enable-unicode-conversion.

initdb -E UNICODE -D /usr/local/pgsql/data
createdb pl_test -E LATIN2

Info about my configuration
---------------------------

PostgreSQL version:
7.1RC1 compiled by gcc 2.95.2

Platform:
Debian GNU/Linux 2.2 Potato on Intel Celeron 366 MHz with 128 MB RAM

Kernel
2.2.19

C library
2.1

Greetings,
Robert

------------------
Robert Gaszewski
graszew@poland.com

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Robert Gaszewski (#1)
Re: LATIN2 and wrong upper() and lower() functions output

Robert Gaszewski writes:

When I try SELECT UPPER('some_text_with_polish_national_chars');
polish chars are still in lower case but others (abcd...wxyz) are
in upper case.

I compiled PostgreSQL with --enable-multibyte and
--enable-unicode-conversion.

Case conversion and ordering are controlled by *locale*, not multibyte.
You need to configure with --enable-locale and set the appropriate LC_*
variables.

http://www.postgresql.org/devel-corner/docs/postgres/charset.html#LOCALE

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/