pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: saisantoshi <mr@starsborn.com>
To: pgsql-jdbc@postgresql.org
Subject:  Reading £ character from DB is displaying œ character
Date: Sat, 21 Sep 2013 21:53:02 -0700 (PDT)
Message-ID: <1379825582068-5771897.post@n5.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Hi Everyone,

I am trying to read to read a foreign character from database (Get *£*100)
is giving some other character. I am using plain Java- JDBC connection. Just
wondering if there is anything that needs to be done apart from the below?

Below is the pseudo code:

connection = DriverManager.getConnection(
				
"jdbc:postgresql://127.0.0.1:5432/demodb?useUnicode=yes&characterEncoding=utf-8",
"test",
					"test");

String sql = "select * from test_data";
ResultSet rs = stmt.executeQuery(sql);
			while(rs.next()){

System.out.println(rs.getString(1))  // Returns Get *œ*100

Expected : Get *£*100)

}

DB is UTF-8
Postgres jar version : postgresql-9.0-801.jdbc4.jar

Appreciate if you could let me know if I am missing anything here?

Thanks,
Sai.





--
View this message in context: http://postgresql.1045698.n5.nabble.com/Reading-character-from-DB-is-displaying-character-tp5771897....
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (11+ messages)  latest in thread

Message-ID: <1379825582068-5771897.post@n5.nabble.com>
Permalink:  ../1379825582068-5771897.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1379825582068-5771897.post@n5.nabble.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: mr@starsborn.com
  Subject: Re: Reading £ character from DB is displaying œ character
  In-Reply-To: <1379825582068-5771897.post@n5.nabble.com>
  References: <1379825582068-5771897.post@n5.nabble.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