Re: Character Encoding Question

Поиск
Список
Период
Сортировка
От Don Parris
Тема Re: Character Encoding Question
Дата
Msg-id CAJ-7yo=uoVFmWMo43Wp6mhaPVRbFUkNCFQ7_hPwgchP_Xk_0cw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Character Encoding Question  (Joe Abbate <jma@freedomcircle.com>)
Ответы Re: Character Encoding Question  (Joe Abbate <jma@freedomcircle.com>)
Список psycopg
On Thu, Mar 28, 2013 at 9:21 PM, Joe Abbate <jma@freedomcircle.com> wrote:
On 28/03/13 16:59, Don Parris wrote:
> If I created the database using the UTF-8 encoding, then why would some
> data be encoded differently than the rest?  And how can I control how
> the data gets inserted?  See my previous post, where I mentioned loading
> a good chunk of the data via the \copy command in psql, and then later
> added more via PGAdmin.  Many records seem to work just fine, but quite
> a few others don't - and I was just naively entering or loading data
> without knowing any encoding was being changed.

If the database is created with UTF-8 encoding, all character data will
be encoded as UTF-8.  The problem was that your client was using
SQL_ASCII encoding so any UTF-8, non-ASCII data (i.e., characters above
decimal 127) received from PG couldn't be decoded.  IIRC the client
encoding is set according to the template0 encoding.  I would do a psql
-l to see the encoding of other databases in your cluster, in particular
template0, template1 and postgres.

From the postgresql.conf file:
#client_encoding = sql_ascii        # actually, defaults to database encoding

The way I understand it, the client should default to whatever encoding the DB uses.  Sounds like they tried to make it difficult to do what I apparently did.


--
D.C. Parris, FMP, Linux+, ESL Certificate
Minister, Security/FM Coordinator, Free Software Advocate
GPG Key ID: F5E179BE

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

Предыдущее
От: Don Parris
Дата:
Сообщение: Re: Character Encoding Question
Следующее
От: Don Parris
Дата:
Сообщение: Re: Character Encoding Question (Solved)