Re: How to convert Big5 to UTF8

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Alex CS Huang <alex(at)smoc(dot)com(dot)tw>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to convert Big5 to UTF8
Date: 2006-01-20 13:57:43
Message-ID: 20060120135743.GA31908@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Vollmer 2006-01-20 14:01:59 Creation of tsearch2 index is very slow
Previous Message Sebastjan Trepca 2006-01-20 13:47:26 Re: How to fetch rows with multiple values