Re: Charset encoding and accents - Mailing list pgsql-hackers

From Davide Romanini
Subject Re: Charset encoding and accents
Date
Msg-id 3E96D477.2060207@libero.it
Whole thread Raw
In response to Re: Charset encoding and accents  (Barry Lind <blind@xythos.com>)
Responses Re: Charset encoding and accents  (Barry Lind <blind@xythos.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Question about simple function folding optimization
Next
From: "scott.marlowe"
Date:
Subject: Re: Speed of SSL connections; cost of renegotiation