Re: JDBC to load UTF8@psql to latin1@mysql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: JDBC to load UTF8@psql to latin1@mysql
Date: 2012-12-13 21:13:27
Message-ID: 11655.1355433207@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul Jungwirth <pj(at)illuminatedcomputing(dot)com> writes:
> Yeah, I agree this is the right answer here, since you're using JDBC. By
> the time you get a String from the MySQL driver, it's already in Java's
> 2-bytes-per-char format. And the Postgres driver will deal with the
> encoding on the output side. So the code I provided won't help you. I'm
> afraid I don't know about Mybatis, but if it's built on JDBC I'd think
> you've just got a configuration problem with what encoding the client
> expects at either end.

I was wondering if the problem wasn't lots simpler than that. Is the
character the OP is trying to convert actually part of LATIN1?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Angelico 2012-12-13 21:15:15 Re: How to keep the last row of a data set?
Previous Message Edson Richter 2012-12-13 21:00:09 Re: How to keep the last row of a data set?