Search Postgresql Archives

Re: invalid byte sequence for encoding "UTF8": 0xab

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It turns out that my problem was that the editor I was using (emacs) does not properly support utf8 encoding.

-----Original Message-----
From: Albe Laurenz [mailto:laurenz.albe@xxxxxxxxxx]
Sent: Monday, June 08, 2009 5:59 AM
To: Grand, Mark D.; pgsql-general@xxxxxxxxxxxxxx
Subject: RE:  invalid byte sequence for encoding "UTF8": 0xab

Mark D. Grand wrote:
> I am having a vexing problem with a script I am writing to
> populate reference tables in a new database.
>
> I am running postgreSQL 8.3 with psql 8.3.7.
>
> Psql reads this SQL statement:
>
>     INSERT INTO META_AUTH.DOMAIN_META_ASSERTION (TITLE, DESCRIPTION, META_ASSERTION)
>         VALUES ('Super-User Authorization',
>                 'This allows a super-user to administer all meta-data.',
>                 'UserID <Administer> ()');
>
> and I get this message:
>
> ERROR:  invalid byte sequence for encoding "UTF8": 0xab
>
> HINT:  This error can also happen if the byte sequence does
> not match the encoding expected by the server, which is
> controlled by "client_encoding".
>
> It is complaining about the '<' character.  I do not
> understand why.  The database is created the commands
>
> CREATE DATABASE mayyou
>                 WITH OWNER=meta_auth ENCODING='UTF8';
>
> ALTER DATABASE mayyou SET client_encoding = 'UTF8';
>
> When I give psql the \encoding command, it replies
>                 UTF8
>
> Why is it complaining about this valid character code?

The database stores characters in UTF-8, and the client
expects UTF-8 characters, but presumably the characters you
feed into psql are not UTF-8.

If this is some kind of UNIX, it might be instructive to
type 'echo "<" | od -t x1' on the command line.

Also knowing the current locale might help to determine the problem.

Yours,
Laurenz Albe

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information.  If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux