Re: BUG #5801: characters not encoded properly for column names
От | Pavel Stehule |
---|---|
Тема | Re: BUG #5801: characters not encoded properly for column names |
Дата | |
Msg-id | AANLkTin9CoXtE3tQY+pdFwjz=OFLZbyp4fBBxy1Ng3k_@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #5801: characters not encoded properly for column names ("Marc Cousin" <cousinmarc@gmail.com>) |
Ответы |
Re: BUG #5801: characters not encoded properly for column names
|
Список | pgsql-bugs |
Hello Marc, It was entered from a windows cmd console? It doesn't use win encodings as default. For example, it must be executed with parameter /c chcp 1250 for win1250 encoding. Regards Pavel Stehule 2010/12/23 Marc Cousin <cousinmarc@gmail.com>: > > The following bug has been logged online: > > Bug reference: =C2=A0 =C2=A0 =C2=A05801 > Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Marc Cousin > Email address: =C2=A0 =C2=A0 =C2=A0cousinmarc@gmail.com > PostgreSQL version: 9.0.2 > Operating system: =C2=A0 Windows XP > Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0characters not encoded properly f= or column names > Details: > > I get a different behaviour between a Linux and a Windows server, when a > user creates an accentuated column name. > > All tests below were done with a linux psql client, the console being set= on > win1252 charset (so the input character is truly '=C3=A9' in win1252) > > With the Linux server : > marc=3D# SET client_encoding TO 'win1252'; > SET > marc=3D# CREATE TABLE test (nom varchar, pr=C3=A9nom varchar); > CREATE TABLE > > > marc=3D# \d test > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Table "public.test" > > > =C2=A0Column | =C2=A0 =C2=A0 =C2=A0 Type =C2=A0 =C2=A0 =C2=A0 =C2=A0| Mod= ifiers > > > --------+-------------------+----------- > > > =C2=A0nom =C2=A0 =C2=A0| character varying | > > > =C2=A0pr=C3=A9nom | character varying | > > 'pr=C3=A9nom' is also displayed correctly if client_encoding and console = are > UTF8, so the conversion is good. > > With the Windows server : > test=3D# SET client_encoding TO 'win1252'; > SET > test=3D# CREATE TABLE test (nom varchar, pr=C3=A9nom varchar); > CREATE TABLE > test=3D# \d test > ERROR: =C2=A0invalid byte sequence for encoding "UTF8": 0xe3a96e > test=3D# SELECT attname from pg_attribute where attrelid =3D (select oid = from > pg_class where relname =3D 'test'); > ERROR: =C2=A0invalid byte sequence for encoding "UTF8": 0xe3a96e > test=3D# select version(); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 version > ------------------------------------------------------------- > =C2=A0PostgreSQL 9.0.2, compiled by Visual C++ build 1500, 32-bit > (1 row) > > > The main reason that this is a problem is that the table cannot be pg_dum= ped > anymore because of this. > > -- > Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-bugs >
В списке pgsql-bugs по дате отправления: