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

Re: Troubles using German Umlauts with JDBC

From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Alexander Troppmann <talex(at)globalinxs(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Troubles using German Umlauts with JDBC
Date: 2001-09-04 13:54:27
Message-ID: 999611669.1171.7.camel@inspiron.cramers (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbc
Alexander,

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

Dave
On Tue, 2001-09-04 at 09:16, Alexander Troppmann wrote:
> Hi,
> 
>   we have troubles with German umlauts (e.g.: äüÖ) using the Postgresql JDBC
>   driver form the 7.1.2 distribution... already tried to debug our Java
>   software but it seems that the database driver modifies the umlauts in any
>   way - a debug before any INSERT or after a SELECT query shows that the
>   umlaut "ü" for example gets lost on the way though the JDBC driver...
> 
>   So e.g. the attribute city='München' gets "M\?nchen" when testing the JDBC
>   driver using a simple Java program.
> 
>   Any idea what happens?
> 
>   Best regards,
>   Alex T.
> 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> 
> 




In response to

Responses

pgsql-hackers by date

Next:From: Doug McNaughtDate: 2001-09-04 14:46:12
Subject: Re: Fw: Random strings
Previous:From: Tom LaneDate: 2001-09-04 13:50:49
Subject: Re: Bytea/Base64 encoders for libpq - interested?

pgsql-jdbc by date

Next:From: Gunnar RønningDate: 2001-09-04 14:32:26
Subject: Re: Need help with JDBC driver. Problem, - getExportedKeys
Previous:From: andyDate: 2001-09-04 13:50:57
Subject: Re: JAVA vs PERL : PERL wins to postgreSQL

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