Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jHxl1-0001MU-AL for pgsql-general@arkaria.postgresql.org; Fri, 27 Mar 2020 22:47:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHxkx-0007XT-FH for pgsql-general@arkaria.postgresql.org; Fri, 27 Mar 2020 22:47:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHxkx-0007XM-4E for pgsql-general@lists.postgresql.org; Fri, 27 Mar 2020 22:47:15 +0000 Received: from campbell-lange.net ([178.79.140.51]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHxkq-0000p4-I4 for pgsql-general@lists.postgresql.org; Fri, 27 Mar 2020 22:47:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=campbell-lange.net; s=it; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WC3cBCoYTzZHoqx2vbPM9Vb/WxzpYjbq/mnWZC+I7Uw=; b=s2s0HKS8m9O5bPwU1IkghBmAr H3I5VlgG6Va6AieLFhGGr3Hjy2Rm5InkF4u1WqD1pxUqnBFwSYhpBo/AkzgYTe/NZn5i9Ls0ZC2vG UAelwwJ4z+c2uNdiqC+H/ljFoyuFGOYrFXu28QkmIw3S0WVnRTE0JUz4YuMBVflL+C4l0=; Received: from 186.164.198.146.dyn.plus.net ([146.198.164.186] helo=rory-t450s) by campbell-lange.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHxkn-0006o0-M7; Fri, 27 Mar 2020 22:47:05 +0000 Received: from rory by rory-t450s with local (Exim 4.92) (envelope-from ) id 1jHxlE-0007RX-I5; Fri, 27 Mar 2020 22:47:32 +0000 Date: Fri, 27 Mar 2020 22:47:32 +0000 From: Rory Campbell-Lange To: Andrew Gierth Cc: Thomas Munro , Tom Lane , Matthias Apitz , "pgsql-generallists.postgresql.org" Subject: Re: \COPY to accept non UTF-8 chars in CHAR columns Message-ID: <20200327224732.GA28471@campbell-lange.net> References: <20200327153623.GA32266@sh4-5.1blu.de> <8922.1585323994@sss.pgh.pa.us> <87k135a2hd.fsf@news-spur.riddles.org.uk> <20200327221835.GA27613@campbell-lange.net> <87ftdta0qs.fsf@news-spur.riddles.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ftdta0qs.fsf@news-spur.riddles.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 27/03/20, Andrew Gierth (andrew@tao11.riddles.org.uk) wrote: > >>>>> "Rory" == Rory Campbell-Lange writes: > > Rory> Or: > > Rory> iconv -f WINDOWS-1252 -t UTF-8 -c < tempfile2 > tempfile3 > > No. That's just a conversion of win1252 to utf8 without regard for any > UTF8 that might already be present in the input. Any such input will end > up double-encoded, requiring further work to fix. My apologies. I missed the subtlety of the substitution in your perl code.