pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Barry Lind <blind@xythos.com>
To: Gunnar Giesinger <mailinglists@gmx.at>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: German Special Chars (Umlaute)
Date: Tue, 04 May 2004 20:22:04 -0700
Message-ID: <40985DDC.9090601@xythos.com> (raw)
In-Reply-To: <000001c43222$63b8f880$8600a8c0@johncleese>
References: <000001c43222$63b8f880$8600a8c0@johncleese>

Gunnar,

There are a variety of things that could be going wrong.  But I would 
first suspect the fact that you didn't specify what character set to use 
in your System.out.println() calls.  Because you didn't specify, java 
will use its default which may or may not be what you want.  You also 
don't show how you are getting the data into this table, so the problem 
may be that the data is corrupted while being inserted.

--Barry


Gunnar Giesinger wrote:
> hi everybody!
> 
> I need to set up a database that should be able to contain values that
> include German special chars (Umlauts like &Auml;&auml;...). I therefore
> created a database with 'LATIN1' as character encoding.
> 
> Afterwards I tried to access a table containing only one character
> varying field for test purposes via JDBC: 
> 
> 	Class.forName("org.postgresql.Driver");
> 	String url = "jdbc:postgresql://server:5432/umlaute";
> 	Properties info = new Properties();
> 	info.put("user", "usr");
> 	info.put("password", "pw");
> 	Connection con = DriverManager.getConnection(url, info);
> 	Statement stmt = con.createStatement();
> 	ResultSet rst = stmt.executeQuery("SELECT * FROM test");
> 	rst.next();
> 	System.out.println(rst.getString(1));
> 
> Everything works fine except instead of all the German special chars
> strange symbols are displayed.
> 
> Does anybody know how to fix this problem?
> 
> Thanks
> 
> john
> 
> used system: PostgreSQL 7.3.4 on fedora core 1
> 		 MS Windows Client
> 		 various JDBC drivers tested
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match




view thread (3+ messages)  latest in thread

Message-ID: <40985DDC.9090601@xythos.com>
Permalink:  ../40985DDC.9090601@xythos.com/
Also on:    postgresql.org/message-id/40985DDC.9090601@xythos.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: blind@xythos.com, mailinglists@gmx.at
  Subject: Re: German Special Chars (Umlaute)
  In-Reply-To: <40985DDC.9090601@xythos.com>
  References: <000001c43222$63b8f880$8600a8c0@johncleese> <40985DDC.9090601@xythos.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox