Re: Weird encoding behavior

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Leonardo M(dot) Ramé" *EXTERN* <martinrame(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Weird encoding behavior
Date: 2009-03-26 09:53:59
Message-ID: D960CB61B694CF459DCFB4B0128514C202FF650A@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Leonardo M. Ramé wrote:
> Hi, I'm experiencing a weird behavior when storing latin characters to a
> PostgreSQL 8.3.1.876 server. The database is Latin1 encoded, and it is
> working since September 2008, it wasn't updated nor replaced since its
> first installation.
>
> The weirdness of the problem is that sometimes the characters are stored
> correctly, but sometimes doesn't (allways by the same program), the
> field type is Varchar(30), and for example the text "NUÑEZ" is stored as
> "NU?EZ".
>
> The data comes from an external application in an XML file (also
> Latin1), then, a Delphi service parses the XML and create the
> Insert/Update statements to store the data in the database. I'd try to
> reproduce the bug by sending XML files with 'Ñ' to the service, but it
> is stored correctly.
>
> Also, there's a front end that allows users to see/edit the data in a
> user friendlier way. Again, I checked by inserting records with 'Ñ'
> using this front-end, and also are stored correctly.
>
> Does anyone faced the same problem? any workaround?

Well, there *must* be one client that stores wrong data...

As a first step, can you find out the code point of the character that
is represented as "?" in your E-Mail?

Something like
SELECT ascii(substr('NU?EZ', 3, 1));
except that instead of the string literal you substitute the column
containing the bad value.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2009-03-26 10:30:01 Re: intermittant performance problem
Previous Message Albe Laurenz 2009-03-26 09:44:34 Re: [ADMIN] Can we load all database objects in memory?