Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U627f-0005Bk-67 for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Feb 2013 16:57:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U627e-0002S1-Ls for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Feb 2013 16:57:22 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U627d-0002Rw-OE for pgsql-hackers@postgresql.org; Thu, 14 Feb 2013 16:57:21 +0000 Received: from outmail149113.authsmtp.com ([62.13.149.113]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U627b-00055n-Ga for pgsql-hackers@postgresql.org; Thu, 14 Feb 2013 16:57:21 +0000 Received: from mail-c232.authsmtp.com (mail-c232.authsmtp.com [62.13.128.232]) by punt5.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id r1EGvCiO059710; Thu, 14 Feb 2013 16:57:12 GMT Received: from ayaki.localdomain (124-169-220-232.dyn.iinet.net.au [124.169.220.232]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id r1EGv2ML025946 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 14 Feb 2013 16:57:06 GMT Message-ID: <511D175D.9020308@2ndquadrant.com> Date: Fri, 15 Feb 2013 00:57:01 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Peter Eisentraut CC: Greg Stark , Tom Lane , Noah Misch , Alexander Law , pgsql-hackers , Magnus Hagander , Andrew Dunstan Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console References: <20121018154650.GA3763@alvh.no-ip.org> <51001879.3000207@gmail.com> <5100F3F6.3050107@2ndQuadrant.com> <51013C2C.5020703@dunslane.net> <20130124161954.GA2448@tornado.leadboat.com> <5101A1C4.3020407@dunslane.net> <5107656C.1050400@gmail.com> <28316.1359471244@sss.pgh.pa.us> <20130130015155.GD3524@tornado.leadboat.com> <5108B6E1.9070503@gmail.com> <20130210210259.GA7401@tornado.leadboat.com> <16160.1360540050@sss.pgh.pa.us> <511D14C1.1040100@gmx.net> In-Reply-To: <511D14C1.1040100@gmx.net> X-Enigmail-Version: 1.5.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Server-Quench: 922d5b16-76c7-11e2-b10b-0025903375e2 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksafhtFaQFba1xT HGQLWldEUVt7XGR/ awMfbAdZfEtIVhto UkhXQFFQCwdtAxke B1BcU2wFMQc7BH5y YE9mWD5ZWEV7dAh0 QEwAED8HY3pnbjMY TUFZIgFJIgJKLAJF alJ6XXMOYmICM3gu JQJhdwMRFB58BR5u d0knEH1aChlXT2Vu DygFBikqFFYZSj97 KhE9MVcTEV1ZL0Mo PFItUFgcPlcTDEVX V35MBiNeOEJjDyEs CxhdWUN2 X-Authentic-SMTP: 61633235383639.1019:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.169.220.232/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 02/15/2013 12:45 AM, Peter Eisentraut wrote: > On 2/11/13 10:22 PM, Greg Stark wrote: >> On Sun, Feb 10, 2013 at 11:47 PM, Tom Lane wrote: >>> If we knew that postgresql.conf was stored in, say, UTF8, then it would >>> probably be possible to perform encoding conversion to get string >>> variables into the database encoding. Perhaps we should allow some >>> magic syntax to tell us the encoding of a config file? >>> >>> file_encoding = 'utf8' # must precede any non-ASCII in the file >> If we're going to do that we might as well use the Emacs standard >> -*-coding: latin-1;-*- > Yes, or more generally perhaps what Python does: > http://docs.python.org/2.7/reference/lexical_analysis.html#encoding-declarations > > (In Python 2, the default is ASCII, in Python 3, the default is UTF8.) Not that Python also respects a BOM in a UTF-8 file, treating the BOM as flagging the file as being UTF-8. "In addition, if the first bytes of the file are the UTF-8 byte-order mark ('\xef\xbb\xbf'), the declared file encoding is UTF-8." IMO we should do the same. If there's no explicit encoding declaration, treat it as UTF-8 if there's a BOM and as the platform's local character encoding otherwise. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers