Re: Bug #659: lower()/upper() bug on ->multibyte<- DB

Поиск
Список
Период
Сортировка
От Enke, Michael
Тема Re: Bug #659: lower()/upper() bug on ->multibyte<- DB
Дата
Msg-id 3CD93C3F.5CCDEA55@wincor-nixdorf.com
обсуждение исходный текст
Ответ на Bug #659: lower()/upper() bug on ->multibyte<- DB  (pgsql-bugs@postgresql.org)
Ответы Re: Bug #659: lower()/upper() bug on ->multibyte<- DB  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Список pgsql-bugs
Tatsuo Ishii wrote:
> > What is the difference between an insert of string and a call to a function with a string argument?
>
> You input "select lower('X')" as ISO-8859-1 encoded, then it is sent
> to the backend. The backend convert it to UTF-8. Then lower() is
> called with an UTF-8 string input. lower() calls tolower() which
> expects the input being ISO-8859-1 since you set locale to de_DE.
> This is the source of the problem.

Excuse me, this seems not the be the source of the problem.
If I call select lower(table_col) from table;
then I also don't get back the lower case character but the original case if it is a multibyte char.
There I have no input from the client to the backend.
I did now also remove all below data directory, exported LC_CTYPE to de_DE.utf8, made an initdb.
With pg_controldata I see LC_CTYPE is de_DE.utf8
Now I no longer get the ERROR: cannot convert UTF-8 to ISO8859-1, but the translation doesn't work:
MB chars are not translated, I get back the original case.
BTW: mbsrtowcs(), wctrans(), towctrans(), wcsrtombs() makes the job with de_DE.utf8.

> Oops. That should be:
>
> select convert(lower(convert('X', 'LATIN1')),'LATIN1','UNICODE');
> It looks ugly, but works.

Sorry, it doesn't work. The same here, I get back the case I put in at X, not the lower case.

Regards,
Michael

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Joel Burton"
Дата:
Сообщение: Re: Bug #661: Update to previous bug report
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Bug #659: lower()/upper() bug on ->multibyte<- DB