Re: [BUG] - Invalid UNICODE character sequence found

From: "Antonio Gallardo" <antonio(at)apache(dot)org>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [BUG] - Invalid UNICODE character sequence found
Date: 2004-01-09 09:17:53
Message-ID: 34723.10.0.0.5.1073639873.squirrel@ags01.agsoftware.dnsalias.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka dijo:
>
>
> On Thu, 8 Jan 2004, Antonio Gallardo wrote:
>
>> Hi:
>>
>> In the tested web application, we use postgreSQL JDBC driver. We have a
>> 1
>> field form where we allow the user to writte a search pattern a table.
>> The
>> generated SQL use LIKE to find for similars. Example:
>>
>> This works fine, even if we left empty the form field, to show all the
>> records.
>>
>> The interesting stuff I found is:
>>
>> If we write just "z", "Z" or any string with that include the chars "z"
>> or
>> "Z" at any point of the string in the field, then I got the below error.
>> How is this posible? I not an UTF-8, ISO-8859-1 or SQL_ASCII expert, but
>> for me "z" or "Z" is part of the ASCII that means a 1 byte code in
>> UTF-8.
>>
>> That means the driver has problems with an normal "z" or "Z"?
>>
>> Note: The same apply for the drivers:
>>
>
> Could you possibly write a standalone Java program that demonstrates this
> error?

What encoding is your database?

builded using:

createdb -E UNICODE mydbname
AFAIK this means it is UTF-8

> What encoding is you web application running in?

All using UTF-8 it is using Cocoon - http://cocoon.apache.org/

> What encoding is used in the browser?

Browser: Mozilla Encoding: ISO-8859-1

I know you can point to the browser as the source of the problem, but I
can insert any char to the database. I can also retrieve all the rows that
include any char from the database if I don't query using the "z" char. It
does not matter if the retrieved values include "z".

The problem is clearly related to the SELECT statement using "z".

Please note I am able to INSERT and UPDATE using the web app interface. I
can also search using other chars as: á é ý ú € etc. Any other char is OK.
Why the "z" (that is part of the ASCII => equal code in UTF-8) is
offending?

This is why I decided to write to the postgreSQL list.

Best Regards,

Antonio Gallardo

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-01-09 09:30:12 Re: JDBC driver doesn't handle NaN values
Previous Message Kris Jurka 2004-01-09 08:46:04 Re: jdbc1.AbstractJdbc1Statement.setBinaryStream bug and