Обсуждение: problems with special characters

Поиск
Список
Период
Сортировка

problems with special characters

От
Karina Guardado
Дата:
Hi list,

I have a problem I have created a database with encoding SQL_ASCII and
when I insert the data using a terminal in linux and insert the data for
example
Insert into mytable values(1,'Eléctrico'); it works fine but if I try to
copy this data from a text file doing \copy mytable from textfile, it
insert the data but instead of é writes a ? and I don't have any idea
how to copy the data without this problem.

I really appreciate your help.

thanks

karina

Re: problems with special characters

От
"Rodrigo E. De León Plicet"
Дата:
On Wed, Nov 26, 2008 at 3:36 PM, Karina Guardado <kguardado@gmail.com> wrote:
> I have a problem I have created a database with encoding SQL_ASCII and when
> I insert the data using a terminal in linux and insert the data for example
> Insert into mytable values(1,'Eléctrico'); it works fine but if I try to
> copy this data from a text file doing \copy mytable from textfile, it insert
> the data but instead of é writes a ? and I don't have any idea how to copy
> the data without this problem.

From the horse's mouth:

"The SQL_ASCII setting behaves considerably differently from the other
settings. When the server character set is SQL_ASCII, the server
interprets byte values 0-127 according to the ASCII standard, while
byte values 128-255 are taken as uninterpreted characters. No encoding
conversion will be done when the setting is SQL_ASCII. Thus, this
setting is not so much a declaration that a specific encoding is in
use, as a declaration of ignorance about the encoding. In most cases,
if you are working with any non-ASCII data, it is unwise to use the
SQL_ASCII setting, because PostgreSQL will be unable to help you by
converting or validating non-ASCII characters."

Source: http://www.postgresql.org/docs/8.3/static/multibyte.html

In other words, use a server encoding that works with your set of
non-ASCII characters.

Good luck.