Re: not valid character for Unicode

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: not valid character for Unicode
Дата
Msg-id 20060609152502.GD26418@svana.org
обсуждение исходный текст
Ответ на Re: not valid character for Unicode  (Adam Witney <awitney@sgul.ac.uk>)
Ответы Re: not valid character for Unicode  (Adam Witney <awitney@sgul.ac.uk>)
Список pgsql-general
On Fri, Jun 09, 2006 at 04:17:50PM +0100, Adam Witney wrote:
> > It's a valid unicode character, it's just you havn't encoded it in
> > unicode. It's probably in Latin-1. In that case, you need to specify it
> > in the client encoding...
>
> Hi Martijn,
>
> thanks for your quick response.
>
> Ok i am a bit confused by all this encoding stuff... i don't really know
> how to encode it in unicode? this is a text string that is extracted
> from a text file, i just put it in an INSERT statement.

The database will do the encoding for you, you just have to tell it
what encoding it is. By default it assumes you're using the same
encoding as the backend. So:

# set client_encoding='latin1';

-- Now all my strings are considered to be in latin1

# set client_encoding='sjis';

-- Now my strings are SJIS

# set client_encoding='unicode';

-- Now my strings need to be utf-8

> I have to replace fields with this in it with a valid string that will
> load into 8.1, do you know who i would do the conversion?

The database will do it for you. Note that the client encoding affects
input *and* output. So if you set it to latin1, the database will
convert all strings to latin1 before sending them to you...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Fabian Pascal and RDBMS deficiencies in fully implementing the relational model
Следующее
От: brian ally
Дата:
Сообщение: Re: not valid character for Unicode