Re: Identical command-line command will not work with \i metacommand and filename

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: John Gage <jsmgage(at)numericable(dot)fr>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Scott Mead <scott(dot)lists(at)enterprisedb(dot)com>, Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Identical command-line command will not work with \i metacommand and filename
Date: 2010-04-25 01:01:39
Message-ID: 201004250101.o3P11dr22284@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-general

John Gage wrote:
> > http://en.wikipedia.org/wiki/Byte_order_mark
> >
> > Tends to get added if you go through a Windows system. Useless for
> > utf-8 afaik. Confuse the hell out of you because various tools parse
> > and hide them then you pipe the file to a script and everything
> > falls over.
> >
> > Bunch of scripts available here to remove them:
> > http://www.xs4all.nl/~mechiel/projects/bomstrip/
>
> Correct. I found the following via Google.
> "I created a file utf8.rb with this content: C:\>ruby -e "p
> File.read('utf8.rb')" "\357\273\277puts \"Hello World\""
> The "\357\273\277" part is the Byte Order Mark for UTF-8, my editor
> automatically put it at the beginning of the file, because I saved it
> as UTF-8."
> At least it isn't some evil virus. Have to do Mr. WorkAround now.

FYI, this is fixed in Postgres 9.0:

Ignore leading UTF-8-encoded Unicode byte-order marker in
psql (Itagaki Takahiro)

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Eric E 2010-04-25 04:15:40 SEVERINE BAILLY
Previous Message Eric E 2010-04-24 12:14:57 La Faubrujon

Browse pgsql-general by date

  From Date Subject
Next Message Andre Lopes 2010-04-25 01:07:29 Problem compiling function with BEGIN WORK; COMMIT WORK;
Previous Message Tom Lane 2010-04-24 23:13:58 Re: Help me stop postgres from crashing.