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

Re: [JDBC] Troubles using German Umlauts with JDBC

From: Rene Pijlman <rene(at)lab(dot)applinet(dot)nl>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: Alexander Troppmann <talex(at)globalinxs(dot)de>, pgsql-hackers(at)postgresql(dot)org, pgman(at)candle(dot)pha(dot)pa(dot)us, Dave Cramer <Dave(at)micro-automation(dot)net>
Subject: Re: [JDBC] Troubles using German Umlauts with JDBC
Date: 2001-09-04 17:03:41
Message-ID: gk1aptcdspcf56ve2un067n88ncj9315is@4ax.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbc
[forwarding to pgsql-hackers and Bruce as Todo list maintainer,
see comment below]

[insert with JDBC converts Latin-1 umlaut to ?]
On 04 Sep 2001 09:54:27 -0400, Dave Cramer wrote:
>You have to set the encoding when you make the connection.
>
>Properties props = new Properties();
>props.put("user",user);
>props.put("password",password);
>props.put("charSet",encoding);
>Connection con = DriverManager.getConnection(url,props);
>where encoding is the proper encoding for your database

For completeness, I quote the answer Barry Lind gave yesterday. 

"[the driver] asks the server what character set is being used
for the database.  Unfortunatly the server only knows about
character sets if multibyte support is compiled in. If the
server is compiled without multibyte, then it always reports to
the client that the character set is SQL_ASCII (where SQL_ASCII
is 7bit ascii).  Thus if you don't have multibyte enabled on the
server you can't support 8bit characters through the jdbc
driver, unless you specifically tell the connection what
character set to use (i.e. override the default obtained from
the server)."

This really is confusing and I think PostgreSQL should be able
to support single byte encoding conversions without enabling
multi-byte. 

To the very least there should be a --enable-encoding-conversion
or something similar, even if it just enables the current
multibyte support.

Bruce, can this be put on the TODO list one way or the other?
This problem has appeared 4 times in two months or so on the
JDBC list.

Regards,
René Pijlman <rene(at)lab(dot)applinet(dot)nl>

In response to

Responses

pgsql-hackers by date

Next:From: Larry RosenmanDate: 2001-09-04 17:13:00
Subject: Re: Bytea/Base64 encoders for libpq - interested?
Previous:From: Bruce MomjianDate: 2001-09-04 16:44:49
Subject: Re: Bytea/Base64 encoders for libpq - interested?

pgsql-jdbc by date

Next:From: Bruce MomjianDate: 2001-09-04 17:15:57
Subject: Re: Read transactions don't work on 7.0.x db's Disregard my other
Previous:From: Rene PijlmanDate: 2001-09-04 16:50:00
Subject: Why JDBC 1?

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