Re: Bug #659: lower()/upper() bug on ->multibyte<- DB
От | Tatsuo Ishii |
---|---|
Тема | Re: Bug #659: lower()/upper() bug on ->multibyte<- DB |
Дата | |
Msg-id | 20020508120947C.t-ishii@sra.co.jp обсуждение исходный текст |
Ответ на | Bug #659: lower()/upper() bug on ->multibyte<- DB (pgsql-bugs@postgresql.org) |
Список | pgsql-bugs |
> Short Description > lower()/upper() bug on ->multibyte<- DB > > Long Description > OS: Linux Kernel 2.4.4, PostgreSQL version 7.2.1 > lower() and upper() doesn't work like expected for multibyte > databases. It is working fine for one-byte encoding. > The behaviour can be reproduced as follows: > at initdb: LC_CTYPE was set to de_DE > createdb -E UTF-8 name > export PGCLIENTENCODING=LATIN1 > psql -U name > -------------------------------------------------- > => select lower('D'); -- german umlaut A, capital > ERROR: Could not convert UTF-8 to ISO8859-1 > -- I expected to see: d german umlaut a, lower case This is not a bug but an expected behavior. Locale support expects an input string is encoded in ISO-8859-1 (because you set locale to de_DE) while you supply UTF-8. Try an explicit encoding converion function: select lower(convert('D'), 'LATIN1'); Note that '\304' must be an actual german umlaut A, capital character, not an octal espcaped notion. -- Tatsuo Ishii
В списке pgsql-bugs по дате отправления: