Re: How do I change the server encoding?

Поиск
Список
Период
Сортировка
От Antti Haapala
Тема Re: How do I change the server encoding?
Дата
Msg-id Pine.GSO.4.44.0302261048340.2358-100000@paju.oulu.fi
обсуждение исходный текст
Ответ на Re: How do I change the server encoding?  (Joseph Shraibman <jks@selectacast.net>)
Список pgsql-general
On Tue, 25 Feb 2003, Joseph Shraibman wrote:

> Peter Eisentraut wrote:
> > Philippe Kiener writes:
> >>
> >>My database should be transform from SQL_ASCII to utf-8
> >>
> >>I have added that line to my dumps:
> >>
> >>SET CLIENT_ENCODING TO 'SQL_ASCII';
> >>
> >>Now when I load the dump into my db, I get that error on tables with text:
> >>
> >>psql:tcom-database.sql:7111: ERROR:  copy: line 1, Invalid UNICODE character
> >>sequence found (0xe96500)
> >
> >
> > The client encoding SQL_ASCII means that the data will be passed through
> > unchanged.  Try setting it to LATIN1.
> >
> I tried with latin1 and it didn't work.

Hmm... still caused errors? I think that because newer dumps have those
\connects, you need to add explicit char set settings after all of those.

The better way would be converting the whole dump with iconv, though.
Iconv comes by default with many unixen. For example command

    iconv -f iso-8859-1 -t utf-8 < text_dump > text_dump_converted

will convert your dump from latin1 to utf-8.

--
Antti Haapala


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

Предыдущее
От: Joe Tomcat
Дата:
Сообщение: Re: 7.4?
Следующее
От: "Peter Alberer"
Дата:
Сообщение: how to recover after harddisk error