Encoding issues - Mailing list pgsql-jdbc

From Jeff Davis
Subject Encoding issues
Date
Msg-id 1217613920.16813.168.camel@dell.linuxdev.us.dell.com
Whole thread Raw
Responses Re: Encoding issues  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
MD5Digest.encode() calls password.getBytes("US-ASCII") and the same for
the username. This is wrong, because when java converts a non-ASCII
character to US-ASCII, it replaces it with a "?".

Similarly for sendStartupPacket()
in /org/postgresql/core/v3/ConnectionFactoryImpl.java
and /org/postgresql/core/v2/ConnectionFactoryImpl.java.

I'm not sure exactly what it _should_ do, because the connection itself
is done with ASCII (client_encoding is not yet set).

Rather than trying to convert from characters to ASCII, maybe it should
just get the byte sequence, and send that? That appears to be how other
clients (like libpq) work.

It still fails when the client and server encoding don't match, however.

Regards,
    Jeff Davis


pgsql-jdbc by date:

Previous
From: tivvpgsqljdbc@gtech-ua.com
Date:
Subject: Re: numeric type
Next
From: Oliver Jowett
Date:
Subject: Re: Encoding issues