> Hi everyone,
> I have a PostgreSQL 7.4 database running, which was initdb-ed
> using standard
> (SQL_ASCII) encoding, with -lc-collate=C option set.
> Everything is running fine, but I just discovered something
> funny. If text
> containing characters like ë is inserted into the database
> (text field), the
> inserting goes fine. When I view this data using phpPgAdmin
> (v3.2.1) it
> looks fine, including these special characters.
> HOWEVER, when I get this data from within a Delphi application, using
> psqlODBC (07.03.0200), the special characters get corrupted (ë becomes
> something like Ã«). It seems to be a unicode problem.
> What do you think, should I re-create the database using
> UNICODE encoding?
> I'd like to know beforehand if this will solve the problem,
> since I do not
> want to recreate the database just to find out that it does
> not fix things.
> Or does the problem involve psqlODBC. I looked into some of
> its settings,
> but I can't find anything that involves character encoding...
> I hope someone can give me a pointer here.
> Thanks in advance,
> Alexander Priem
> The Netherlands.
I'm a Delphi (7 Enterprise) user myself. I've ran into that sort of encoding problems to. On the postgres backend I use UNICODE.
I'll tell you what I know, I hope it helps a bit.
First off: there seems to be a difference between the datatypes string and widestring in Delphi. widestring is recommended for use with 'wide byte strings' (or something like that), for example UNICODE. string variables however can't be trusted for the full 100% in that case. I don't know exactly how it worked, but I'm sure some browsing in the Delphi Help and other rescources will explain things.
Second: I know that in my case I have to set the CLIENT_ENCODING TO 'LATIN1' in my odbc connect string to make sure that all the characters are translated correct.
I'm sorry that I can't be more specific about these things since I don't remember exactly WHY these things are done, but I do know they help :-) This was all set-up and figured out by one of my colleagues a while ago. I was not excactly into the database itself, but restricted my work to delphi coding en general development.
Therefore I hope that someone else can shed more light onto the matter so I can learn a bit too :-)
pgsql-general by date
|Next:||From: Peter Eisentraut||Date: 2004-04-21 13:22:39|
|Subject: Re: Unicode problem ???|
|Previous:||From: Joe Lester||Date: 2004-04-21 13:04:35|
|Subject: Re: Connection reset by peer|