Re: BUG #7493: Postmaster messages unreadable in a Windows console

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Noah Misch <noah(at)leadboat(dot)com>, Alexander Law <exclusion(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console
Date: 2013-02-14 16:57:01
Message-ID: 511D175D.9020308@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-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(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Euler Taveira 2013-02-14 17:17:22 Re: BUG #7875: org.postgresql.util.PSQLException: ERROR: column reference "e_raci_obj" is ambiguous
Previous Message Peter Eisentraut 2013-02-14 16:45:53 Re: BUG #7493: Postmaster messages unreadable in a Windows console

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-02-14 17:03:21 Re: Runtime variations during day
Previous Message Peter Eisentraut 2013-02-14 16:45:53 Re: BUG #7493: Postmaster messages unreadable in a Windows console

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-02-14 17:00:33 Re: sql_drop Event Trigger
Previous Message Robert Haas 2013-02-14 16:55:35 Re: [RFC] pgstattuple/pgstatindex enhancement