Re: Charset encoding and accents

From: Davide Romanini <romaz(at)libero(dot)it>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Charset encoding and accents
Date: 2003-04-11 14:43:03
Message-ID: 3E96D477.2060207@libero.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

Barry Lind ha scritto:

> The charSet= option will no longer work with the 7.3 driver talking to a
> 7.3 server, since character set translation is now performed by the
> server (for performance reasons) in that senario.
>
> The correct solution here is to convert the database to the proper
> character set for the data it is storing. SQL_ASCII is not a proper
> character set for storing 8bit data.
>

Probably I'm not enough clear about the problem. I *cannot* change
charset type. SQL_ASCII really *is* the proper character set for my
porpuses, because I actually work using psql and ODBC driver without any
problem. I repeat: psql and ODBC retrives all data (with the accents) in
the correct manner. Also, if I change the
org.postgresql.core.Encoding.java making the decodeUTF8 method to return
simply a new String(data), JDBC retrives the data from my SQL_ASCII
database correctly! So my question is: why JDBC calls the decodeUTF8
method also when the string is surely *not* an UTF-8 string? If JDBC
could recognize that the string is *not* an UTF-8 string, then it will
simply return a new String that is the right thing to do.
It's obvious that if JDBC receives from postgresql server a byte array
representing a non-UTF8 string, and it a calls e method that wants as a
parameter a byte array representing an UTF8 string, then it is a *bug*,
because for non-UTF8 strings it must return a new String.

I hope to be enough clear this time.

Sincerely, I'm getting a bit frustrated from the problem, because I've
projects to do and it prevents me to do that projects :-(

Greetings, Romaz
--
Davide Romanini

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message scott.marlowe 2003-04-11 15:07:11 Re: Speed of SSL connections; cost of renegotiation
Previous Message Tom Lane 2003-04-11 14:38:56 Re: Question about simple function folding optimization

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-04-11 15:46:04 Re: error getString() --> decodeUTF8 /
Previous Message Nagesh Yencharla 2003-04-11 13:15:52 passing a String[] to a Stored function