Re: Encoding Issue with UNICODE

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Encoding Issue with UNICODE
Дата
Msg-id 20050411035003.3592776@localhost
обсуждение исходный текст
Ответ на Encoding Issue with UNICODE  (fritz-bayer@web.de (Fritz Bayer))
Список pgsql-general
    Fritz Bayer wrote:

> I have a java program, which writes words containing german umlauts
> like äöü into the database. As you probably know, those characters
> belong to the ISO-8859-1 character encoding set.
>
> In my java webapplication those umlauts (äöü) get displayed correctly.
> So they actually get stored correctly in the database.
>
> However, when I use postgresql's psql client I those characters get
> displayed incorretly.
>
> For example the city name "münchen" gets displayed as "mÌnchen". Not
> so in my webapplication. There the city name in the HTML code appears
> corretly as "münchen".
>
> So why is psql not displaying the unicode characters correclty? Or
> could it be that my xterm can not handle unicode characters?

From your description it really looks like the latter. You can issue
\encoding latin1
inside psql

or you can also set the PGCLIENTENCODING environment variable to latin1
before launching psql on non-unicode aware terminals.

> Can somebody help me out here? Should I create the databases as LATIN1
> instead of UNICODE? And how can I transform my current databases into
> LATIN1 ones? They should be compatible, because all characters I use
> are only äöü, which are downward compatible.

But then you'll have trouble with your java app if you do that. Java works with
unicode strings, so it makes sense to have the db contents in unicode as well.

--
 Daniel
 PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org


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

Предыдущее
От: Edson Vilhena de Carvalho
Дата:
Сообщение: Help!!
Следующее
От: John Burger
Дата:
Сообщение: Re: Duplicate records in table