Re: Error chargement de =?ISO-8859-15?Q?donn=E9es?=.

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Pierre BOIZOT" <pierre(dot)boizot(at)gmail(dot)com>
Cc: "PG-Mail-liste" <pgsql-fr-generale(at)postgresql(dot)org>
Subject: Re: Error chargement de =?ISO-8859-15?Q?donn=E9es?=.
Date: 2013-08-22 13:45:41
Message-ID: 0cc5ced1-bfe4-4f1e-b662-08fd80ff7c20@mm
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-fr-generale

Pierre BOIZOT wrote:

> question que faire pour produire directement le fichier en utf-8 ?

Visiblement c'est configurable:
http://ora2pg.darold.net/config.html

Et spécialement (copier-coller):

Special options to handle character encoding

NLS_LANG

By default Oracle character set is automatically detected, but if you
experience any issues where mutibyte characters are being substituted with
some replacement characters during the export try to set the NLS_LANG
configuration directive to the Oracle encoding. This may help a lot
especially with UTF8 encoding. For example:

NLS_LANG AMERICAN_AMERICA.UTF8

This will set $ENV{NLS_LANG} to the given value.

BINMODE

If you experience the Perl warning: "Wide character in print", it means
that you tried to write a Unicode string to a non-unicode file handle. You
can force Perl to use binary mode for output by setting the BINMODE
configuration option to the specified encoding. If you set it to 'utf8', it
will force printing like this: binmode OUTFH, ":utf8"; By default Ora2Pg
opens the output file in 'raw' binary mode.

CLIENT_ENCODING

By default PostgreSQL client encoding is automatically detected and set
to avoid encoding issue. If you want to defined your own or if you experience
some ERROR: invalid byte sequence for encoding "UTF8": 0xe87472 when loading
data you may want to set the encoding of the PostgreSQL client.

For example, let's say you have an Oracle database with all data encoded
in FRENCH_FRANCE.WE8ISO8859P15, your system use fr_FR.UTF-8 as console
encoding and your PostgreSQL database is encoded in UTF8. What you have to do
is set the NLS_LANG to FRENCH_FRANCE.WE8ISO8859P15 and the CLIENT_ENCODING to
LATIN9.

You can take a look at the PostgreSQL supported character sets here:
http://www.postgresql.org/docs/9.0/static/multibyte.html

Cordialement,
--
Daniel

In response to

Responses

Browse pgsql-fr-generale by date

  From Date Subject
Next Message David TECHER 2013-08-22 14:59:08 Re: PostgreSQL 9.3rc1
Previous Message Stéphane Schildknecht 2013-08-22 13:35:11 PostgreSQL 9.3rc1