8.3 can't convert cyrillic text from 'iso-8859-5' to other cyrillic 8-bit encoding

Поиск
Список
Период
Сортировка
От Sergey Burladyan
Тема 8.3 can't convert cyrillic text from 'iso-8859-5' to other cyrillic 8-bit encoding
Дата
Msg-id 200803171616.34193.eshkinkot@gmail.com
обсуждение исходный текст
Ответы Re: 8.3 can't convert cyrillic text from 'iso-8859-5' to other cyrillic 8-bit encoding  (Sergey Burladyan <eshkinkot@gmail.com>)
Список pgsql-bugs
Hi, all !

I can't convert with convert(bytea, name, name)::bytea from 'iso-8859-5'=20
to 'windows-1251' or any other cyrillic 8-bit encoding.

seb=3D> show client_encoding ;
 client_encoding
-----------------
 UTF8

seb=3D> show server_encoding;
 server_encoding
-----------------
 UTF8

seb=3D> select version();
                                        version
---------------------------------------------------------------------------=
-------------
 PostgreSQL 8.3.0 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3 (Deb=
ian=20
4.2.3-1)

 lc_collate                      | ru_RU.UTF-8
 lc_ctype                        | ru_RU.UTF-8
 lc_messages                     | ru_RU.UTF-8
 lc_monetary                     | ru_RU.UTF-8
 lc_numeric                      | ru_RU.UTF-8
 lc_time                         | ru_RU.UTF-8

seb=3D> select=20
convert(convert('=D0=B0=D0=B1=D0=B2=D0=B3=D0=B4=D0=B5=D1=91=D0=B6=D0=B7=D0=
=B8=D0=B9=D0=BA=D0=BB=D0=BC=D0=BD=D0=BE=D0=BF=D1=80=D1=81=D1=82=D1=83=D1=84=
=D1=85=D1=86=D1=87=D1=88=D1=89=D1=8A=D1=8B=D1=8C=D1=8D=D1=8E=D1=8F=D0=90=D0=
=91=D0=92=D0=93=D0=94=D0=95=D0=81=D0=96=D0=97=D0=98=D0=99=D0=9A=D0=9B=D0=9C=
=D0=9D=D0=9E=D0=9F=D0=A0=D0=A1=D0=A2=D0=A3=D0=A4=D0=A5=D0=A6=D0=A7=D0=A8=D0=
=A9=D0=AA=D0=AB=D0=AC=D0=AD=D0=AE=D0=AF', 'utf-8', 'iso-8859-5'), 'iso-8859=
-5', 'windows-1251');
ERROR:  character 0xf1 of encoding "ISO_8859_5" has no equivalent=20
in "MULE_INTERNAL"

At first - i am convert my console locale encoding (ru_RU.UTF-8) to iso-885=
9-5=20
(cyrillic 8-bit character encoding) and second convert is for show problem.

windows-1251 - is other cyrillic 8-bit character encoding, convert to koi8-=
r=20
also not work.

i am write output of convert(..., 'utf-8', 'iso-8859-5') into file and read=
 it=20
with: iconv -f iso-8859-5 -- all chars readed ok. (see progs in attach)

convert(..., 'iso-8859-5', 'utf-8') looking good, i am check it like this:
seb=3D> set standard_conforming_strings TO on; --- do not escape bytea
SET
seb=3D> select=20
convert('\320\321\322\323\324\325\361\326\327\330\331\332\333\334\335\336\3=
37\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\260\261\=
262\263\264\265\241\266\267\270\271\272\273\274\275\276\277\300\301\302\303=
\304\305\306\307\310\311\312\313\314\315\316\317', 'iso-8859-5', 'utf-8');
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20
convert=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20
---------------------------------------------------------------------------=
---------------------------------------------------------------------------=
---------------------------------------------------------------------------=
---------------------------------------------------------------------------=
---------------------------------------------------------------------------=
---------------------------------------------------------------------------=
---------------------------------------------------------------------------=
-----
=20
\320\260\320\261\320\262\320\263\320\264\320\265\321\221\320\266\320\267\32=
0\270\320\271\320\272\320\273\320\274\320\275\320\276\320\277\321\200\321\2=
01\321\202\321\203\321\204\321\205\321\206\321\207\321\210\321\211\321\212\=
321\213\321\214\321\215\321\216\321\217\320\220\320\221\320\222\320\223\320=
\224\320\225\320\201\320\226\320\227\320\230\320\231\320\232\320\233\320\23=
4\320\235\320\236\320\237\320\240\320\241\320\242\320\243\320\244\320\245\3=
20\246\320\247\320\250\320\251\320\252\320\253\320\254\320\255\320\256\320\=
257
(1 =D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D1=8C)

seb=3D> set standard_conforming_strings TO off; --- now we must escaping by=
tea=20
for show text
SET
seb=3D> select=20
E'\320\260\320\261\320\262\320\263\320\264\320\265\321\221\320\266\320\267\=
320\270\320\271\320\272\320\273\320\274\320\275\320\276\320\277\321\200\321=
\201\321\202\321\203\321\204\321\205\321\206\321\207\321\210\321\211\321\21=
2\321\213\321\214\321\215\321\216\321\217\320\220\320\221\320\222\320\223\3=
20\224\320\225\320\201\320\226\320\227\320\230\320\231\320\232\320\233\320\=
234\320\235\320\236\320\237\320\240\320\241\320\242\320\243\320\244\320\245=
\320\246\320\247\320\250\320\251\320\252\320\253\320\254\320\255\320\256\32=
0\257';
                              ?column?
--------------------------------------------------------------------
 =D0=B0=D0=B1=D0=B2=D0=B3=D0=B4=D0=B5=D1=91=D0=B6=D0=B7=D0=B8=D0=B9=D0=BA=
=D0=BB=D0=BC=D0=BD=D0=BE=D0=BF=D1=80=D1=81=D1=82=D1=83=D1=84=D1=85=D1=86=D1=
=87=D1=88=D1=89=D1=8A=D1=8B=D1=8C=D1=8D=D1=8E=D1=8F=D0=90=D0=91=D0=92=D0=93=
=D0=94=D0=95=D0=81=D0=96=D0=97=D0=98=D0=99=D0=9A=D0=9B=D0=9C=D0=9D=D0=9E=D0=
=9F=D0=A0=D0=A1=D0=A2=D0=A3=D0=A4=D0=A5=D0=A6=D0=A7=D0=A8=D0=A9=D0=AA=D0=AB=
=D0=AC=D0=AD=D0=AE=D0=AF
(1 =D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D1=8C)

it os ok.

text string parameter is russian alphabet from first letter to last, lower=
=20
case, and from first letter to last, UPPER case

may be i am doing something wrong ?

---

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

Предыдущее
От: "Mika Fischer"
Дата:
Сообщение: BUG #4040: psql should provide option to not prompt for password
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4040: psql should provide option to not prompt for password