Skip site navigation (1) Skip section navigation (2)

JDBC and character encoding

From: Aleksey Demakov <avd(at)gcom(dot)ru>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: JDBC and character encoding
Date: 1998-10-09 11:08:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
There is a problem using JDBC on machine with a character encoding
different from one used by backend. For instance, Russian version
of MS Windows uses codepage 1251, while in Russian Unix world most
widely used encoding is koi8-r.

I don't know whether there's standard way of dealing with this. Maybe
because I'm novice with Java & JDBC.

But having Java i18n facilities this problem could be easely solved.
There should be a per-connection property which will contain beckend's
encoding. So connecting with, say, such url
will set this property to "KOI8-R". Functions to convert bytes to
characters and vice versa all have versions that accept encoding
argument. They should be used to perform such conversion.

I currently only have the driver from 6.3.2 distribution. I could
make a patch for it if JDBC maintainers agree with this proposal.


Aleksey Demakov


pgsql-interfaces by date

Next:From: Bryn KellerDate: 1998-10-09 14:19:39
Previous:From: Dave PageDate: 1998-10-09 09:49:41
Subject: pgAdmin Version 6.3.209

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group