Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 25CF61337BA3 for ; Wed, 23 Mar 2011 20:49:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 60737-02 for ; Wed, 23 Mar 2011 23:49:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id 2DFA01337B9C for ; Wed, 23 Mar 2011 20:49:11 -0300 (ADT) Received: from [127.0.0.1] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id p2NNn4w14344; Wed, 23 Mar 2011 16:49:04 -0700 Message-ID: <4D8A86EF.6020502@hogranch.com> Date: Wed, 23 Mar 2011 16:49:03 -0700 From: John R Pierce User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Nathan Davalos CC: pgsql-bugs@postgresql.org Subject: Re: BUG #5944: COPY FROM doesn't work with international characters References: <201103232332.p2NNWwRn083987@wwwmaster.postgresql.org> In-Reply-To: <201103232332.p2NNWwRn083987@wwwmaster.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/301 X-Sequence-Number: 29811 On 03/23/11 4:32 PM, Nathan Davalos wrote: > ... > SET CLIENT_ENCODING TO 'WIN1251'; > copy tmpintermediate from 'thefile.txt'; > > > Sample contents of thefile: > 230002 Alto Desempe=C3=B1o, S.A. De C.V. > > When using WIN1251 or WIN1252 I get nothing in the second field, it jus= t > ignores the data. Same thing for LATIN-1. > > When using UTF8 for client encoding I get this message: > ERROR: invalid byte sequence for encoding "UTF8": 0xf16f2c20 > CONTEXT: COPY tmpintermediate , line 1 what is the byte (binary) encoding of the file? in hex, =C3=B1 in win1251 =3D=3D (no such character. win1251 is cyrillic) =C3=B1 in win1252 =3D=3D F1 =C3=B1 in UTF-8 =3D=3D C3 B1 =20