Thread: How to convert Big5 to UTF8

How to convert Big5 to UTF8

From
Alex CS Huang
Date:
Hi, All,
  I create a database which encoding is UTF8, and create a table test
create table test ( name varchar);
  I insert a data '\244\350' encoding is Big5, I wish translate them to
UTF8, so I use
  insert into test values ('convert('\244\350' using big5_to_utf_8));
  I got an error:
  ERROR:  invalid byte sequence for encoding "UNICODE": 0xe8;

  How could I do for this problem? any ideas.

Alex CS Huang




Re: How to convert Big5 to UTF8

From
Martijn van Oosterhout
Date:
On Fri, Jan 20, 2006 at 09:56:40AM +0800, Alex CS Huang wrote:
> Hi, All,
>   I create a database which encoding is UTF8, and create a table test
> create table test ( name varchar);
>   I insert a data '\244\350' encoding is Big5, I wish translate them to
> UTF8, so I use
>   insert into test values ('convert('\244\350' using big5_to_utf_8));
>   I got an error:
>   ERROR:  invalid byte sequence for encoding "UNICODE": 0xe8;
>
>   How could I do for this problem? any ideas.

How about something like:

\set encoding=big5;
insert into test values ('\244\350');

or maybe: set client_encoding=big5;

within an app.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment