From: John R Pierce <pierce@hogranch.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Java String saving as unicode in database
Date: Sat, 12 Oct 2013 17:38:21 -0700
Message-ID: <5259EB7D.9000004@hogranch.com> (raw)
In-Reply-To: <1381622110422-5774410.post@n5.nabble.com>
References: <1381565943021-5774370.post@n5.nabble.com>
<52597C74.6070104@ttc-cmc.net>
<1381622110422-5774410.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On 10/12/2013 4:55 PM, saisantoshi wrote:
> I tried this but the problem is its not saving in the DB as what I wanted to
> store..
> *Sample\u0020\u0061\u0074\u0020\u0032\u0032\u0042\u0020 text
>
> Its converting the above and storing it in the DB. When I look at the
> database, it is something that I can't understand looking at it. May be its
> an editor problem. How do I view the exact string stored from my windows cmd
> prompt connecting to postgres sql.
Java (and microsoft windows) uses UCS16, while SQL (and unix/linux and
the internet and about everything else) uses UTF8 (but only if its so
configured). with SQL, you have two things, the database encoding, and
the client_encoding, the latter can be changed on the fly, while the
former is setup when the database is initialized and created.
--
john r pierce 37N 122W
somewhere on the middle of the left coast
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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: pierce@hogranch.com
Subject: Re: Java String saving as unicode in database
In-Reply-To: <5259EB7D.9000004@hogranch.com>
References: <1381565943021-5774370.post@n5.nabble.com> <52597C74.6070104@ttc-cmc.net> <1381622110422-5774410.post@n5.nabble.com> <5259EB7D.9000004@hogranch.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