Re: What's a good default encoding?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: What's a good default encoding?
Дата
Msg-id 20060316112431.GD20889@svana.org
обсуждение исходный текст
Ответ на Re: What's a good default encoding?  (CSN <cool_screen_name90001@yahoo.com>)
Список pgsql-general
On Thu, Mar 16, 2006 at 03:11:27AM -0800, CSN wrote:
> I tried changing my database to UTF8 and then
> importing the dump (even tried iconv). It choked (on
> an accented e). Then somehow the database got created
> as LATIN9, and I was able to import successfully. I
> guess if it works, I'll be leaving it alone for the
> time being.

Note, when you create a dump, pg_dump adds a "set client_encoding" at
the top of the dump. If you change the encoding using iconv without
changing that line, you'll get problems in the import. In theory
dumping from a latin9 database into a utf8 one should Just Work(tm)
because PostgreSQL will convert the data while loading.

> I still have problems when emdashes are stored in the
> database as HTML entities, but they're displayed as
> emdashes in a web form, but then get stored back in
> the database wrong when edited (an accented A IIRC). I
> dunno - maybe it's a browser or Rails thing.

I think the stuff submitted by the browser has a given encoding and
won't be encoded with HTML entities. Converting unicode to HTML
entities has to be done somewhere there...

Hope this helps,
--
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.

Вложения

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

Предыдущее
От: CSN
Дата:
Сообщение: Re: What's a good default encoding?
Следующее
От: Linda
Дата:
Сообщение: Re: question about postgresql time intervals