pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: David Gagnon <dgagnon74@hotmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC and Latin1 Database problem
Date: Wed, 05 Jan 2005 15:55:21 +1300
Message-ID: <41DB5719.5080702@opencloud.com> (raw)
In-Reply-To: <BAY17-F4793E7DA8B91F1D406AE3A6920@phx.gbl>
References: <BAY17-F4793E7DA8B91F1D406AE3A6920@phx.gbl>

David Gagnon wrote:

> To inform the jdbc driver that it must converts caracters I put the 
> following URL in my server.xml (notice the encoding=latin1).  Without 
> this variable caracter é takes 2 spaces in the latin db.  So éééééé will 
> takes 12 spaces.  This make my varchar(10) to small.

> jdbc:postgresql://127.0.0.1:5432/webCatalog?encoding=latin1

The 'encoding' parameter is only used for connections to pre-7.3 
servers; in other cases it is ignored.

What is the database encoding? ("SHOW server_encoding")

>  Error executing: INSERT INTO AK  (AKNUM,AKDESC_PRI, 
> AKDESC_SEC,AKFRAIS,AKTAUX,AKTYPE) VALUES 
> ('CHEQ','CH?QUE','CHEQUE',22,null,1)
> org.postgresql.util.PSQLException: ERROR: could not convert UTF-8 
> character 0x00ef to ISO8859-1

Are you constructing this entire query string yourself, or are you using 
a PreparedStatement with parameters?

Can you show us some sample code that demonstrates the problem?

-O



view thread (5+ messages)  latest in thread

Message-ID: <41DB5719.5080702@opencloud.com>
Permalink:  ../41DB5719.5080702@opencloud.com/
Also on:    postgresql.org/message-id/41DB5719.5080702@opencloud.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: oliver@opencloud.com, dgagnon74@hotmail.com
  Subject: Re: JDBC and Latin1 Database problem
  In-Reply-To: <41DB5719.5080702@opencloud.com>
  References: <BAY17-F4793E7DA8B91F1D406AE3A6920@phx.gbl> <41DB5719.5080702@opencloud.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