|Subject:||Re: invalid byte sequence for encoding "UTF8": 0x00|
|From:||Csaba Nagy (na...@ecircle-ag.com)|
|Date:||Feb 20, 2007 3:13:16 am|
I've had the same error, and it is in fact because in Java you can actually have a "0x0" character in your string, and that's valid unicode. So that's translated to the character 0x0 in UTF8, which in turn is not accepted because the server uses null terminated strings... so the only way is to make sure your strings don't contain the character '\u0000'.
I identified the place in my code which was generating such a character and fixed, and I didn't have other problems after that... even if I still think forbidding a valid character is a somewhat arbitrary restriction.
On Tue, 2007-02-20 at 11:57, Altaf Malik wrote:
Try to change the encoding of your database to "Unicode". I hope this helps.
--Altaf Malik EnterpriseDB www.enterprisedb.com James Im <im-j...@hotmail.com> wrote: Hi,
I've got another problem. I sometimes get the following SQLException when doing an insert:
ERROR: invalid byte sequence for encoding "UTF8": 0x00
By the way, the insert is done with a PreparedStatement and I use only setLong(), setString(), setTimestamp() and setInt().
I don't understand it very well. It is obviously an encoding exception but I don't know why it happens and what I could do avoid it.
_________________________________________________________________ Opret en personlig blog og del dine billeder på MSN Spaces: http://spaces.msn.com/
---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majo...@postgresql.org so that your message can get through to the mailing list cleanly
______________________________________________________________________ Don't get soaked. Take aquick peak at the forecast with theYahoo! Search weather shortcut.