Re: Migration error " invalid byte sequence for encoding "UTF8": 0xff " from mysql 5.5 to postgresql 9.1

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: sunpeng <bluevaley(at)gmail(dot)com>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Migration error " invalid byte sequence for encoding "UTF8": 0xff " from mysql 5.5 to postgresql 9.1
Date: 2014-07-01 13:18:28
Message-ID: 1404220708.34556.YahooMailNeo@web122301.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

sunpeng <bluevaley(at)gmail(dot)com> wrote:

> load data to postgresql in cmd(encoding is GBK) is WIN8:

> psql -h localhost  -d test -U postgres <  dbdata.sql
>
> I got the error:
> ERROR:  invalid byte sequence for encoding "UTF8": 0xff

If the encoding is GBK then you will get errors (or incorrect
characters) if it is read as UTF8.  Try setting the environment
variable PGCLIENTENCODING.

http://www.postgresql.org/docs/9.1/static/app-psql.html

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jacob Bunk Nielsen 2014-07-01 13:35:19 Next steps in debugging database storage problems?
Previous Message sunpeng 2014-07-01 12:42:07 Migration error " invalid byte sequence for encoding "UTF8": 0xff " from mysql 5.5 to postgresql 9.1