Re: UTF8 with BOM support in psql

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>
Cc: Peter Eisentraut <peter_e@gmx.net>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 2009-11-18T04:22:34Z
Lists: pgsql-hackers

Itagaki Takahiro wrote:
> I don't want user to check the encoding of scripts before executing --
> it is far from fail-safe.
>
>
>   

That's what we require in all other cases. Why should UTF8 be special? 
If I have a script in Latin1 and Postgres thinks it's UTF8 it will 
probably explode. Same for the reverse situation. Second-guessing the 
user strikes me as being quite as dangerous as what you're trying to 
cure, for all the reasons Tom outline earlier today. What is more, you 
will teach Windows users to rely on the client encoding being set in 
UTF8 scripts without their doing anything, and then when they get on 
another platform they will not understand why it doesn't work because 
the BOMs will be missing.

cheers

andrew