From: Craig Ringer <craig@2ndquadrant.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Greg Stark <stark@mit.edu>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Noah Misch <noah@leadboat.com>
Cc: Alexander Law <exclusion@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Andrew Dunstan <andrew@dunslane.net>
Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console
Date: Fri, 15 Feb 2013 00:57:01 +0800
Message-ID: <511D175D.9020308@2ndquadrant.com> (raw)
In-Reply-To: <511D14C1.1040100@gmx.net>
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>
<CAM-w4HOpZfoaXwS8Tb114XaXS=3psLBFqaWb0ZZFG2keS+CbdQ@mail.gmail.com>
<511D14C1.1040100@gmx.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
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 <tgl@sss.pgh.pa.us> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: craig@2ndquadrant.com, peter_e@gmx.net, stark@mit.edu, tgl@sss.pgh.pa.us, noah@leadboat.com, exclusion@gmail.com, pgsql-hackers@postgresql.org, magnus@hagander.net, andrew@dunslane.net
Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console
In-Reply-To: <511D175D.9020308@2ndquadrant.com>
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> <CAM-w4HOpZfoaXwS8Tb114XaXS=3psLBFqaWb0ZZFG2keS+CbdQ@mail.gmail.com> <511D14C1.1040100@gmx.net> <511D175D.9020308@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox