答复: [JDBC] invalid byte sequence for encoding "UTF8": 0x00

From: "liuyuanyuan" <liuyuanyuangogo(at)gmail(dot)com>
To: "'Albe Laurenz'" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: 答复: [JDBC] invalid byte sequence for encoding "UTF8": 0x00
Date: 2014-09-01 02:04:24
Message-ID: 006001cfc589$1102c7a0$330856e0$@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-jdbc

Hi, Laurenz Albe!
Thanks for all your help! I've understand. Thank you so much!

Best Regards!
Jasmine

-----邮件原件-----
发件人: Albe Laurenz [mailto:laurenz(dot)albe(at)wien(dot)gv(dot)at]
发送时间: 2014年8月29日 17:58
收件人: liuyuanyuan *EXTERN*
主题: RE: [JDBC] invalid byte sequence for encoding "UTF8": 0x00

> Are there other error encoded Strings that I haven't catch?
> If there other error encoded String occurs, maybe my program will catch exception again.
> Is there a foolproof method that could resolve all problem caused by encoding ?

To the best of my knowledge, all you need to check is if the data is valid
UTF-8 and does not contain a \u0000 character.
Then PostgreSQL should not have a problem with it (the server encoding is UTF8, otherwise it may be that the server cannot store a valid character).

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Albe Laurenz 2014-09-01 08:41:55 Re: invalid byte sequence for encoding "UTF8": 0x00
Previous Message lalit jangra 2014-08-31 16:45:33 Fwd: Getting invalid page header in block while vacuuming PostgreSQL DB.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Albe Laurenz 2014-09-01 08:41:55 Re: invalid byte sequence for encoding "UTF8": 0x00
Previous Message Andreas Joseph Krogh 2014-08-30 17:21:41 Re: invalid byte sequence for encoding "UTF8": 0x00