Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XOGzg-00064p-Lq for pgsql-admin@arkaria.postgresql.org; Mon, 01 Sep 2014 02:05:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XOGzf-0005qE-7N for pgsql-admin@arkaria.postgresql.org; Mon, 01 Sep 2014 02:05:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XOGzc-0005oY-UM for pgsql-admin@postgresql.org; Mon, 01 Sep 2014 02:05:17 +0000 Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XOGzT-0007oH-Kx for pgsql-admin@postgresql.org; Mon, 01 Sep 2014 02:05:14 +0000 Received: by mail-pd0-f180.google.com with SMTP id p10so4913409pdj.39 for ; Sun, 31 Aug 2014 19:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:thread-index :content-language; bh=oH6tYTkqElQFXqHysZ/SKiHGAcBNPZPxwYXAsS5YLJ8=; b=snjsknLpwn8716RgbJ41NT1gET+uaFzAJu/3VaRfrSvdmnPzgJ1XV3PgR664/aZM/g zmLZsprnyOyG5RW4OC3g0P0/sakdSnqFsIpwb/mJM+n0jH84HdfP9cgel4FV8UHMAiIf 5dTJ55LzF1qZ0nFPVGOy2T0/sCcYNqqLzrGPklS+Wm2QS4lm+o0y+P9nnvxFIKw5PfbH E/4S6wNhybMeiw7+/8Ej3j8M1/r6Ew2hBGm7ydbbO92PV1Rw/H4xYSI5MkyXavQecx8R 9diHl2p1EoxGVdxtjlF59O+E9dAMyIQQSqxZJ6Dbfqe28fGwOuNHwpxQ/xYaeE55HxI/ GGgg== X-Received: by 10.70.37.67 with SMTP id w3mr34928498pdj.107.1409537103158; Sun, 31 Aug 2014 19:05:03 -0700 (PDT) Received: from YuanyuanPC ([58.58.27.50]) by mx.google.com with ESMTPSA id tc2sm6431267pbc.30.2014.08.31.19.05.00 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 31 Aug 2014 19:05:02 -0700 (PDT) From: "liuyuanyuan" To: "'Albe Laurenz'" Cc: References: <45DAE076.1060407@opencloud.com> <45DD3A3F.5050609@kensystem.com> <1409125398008-5816498.post@n5.nabble.com> <1409127765169-5816502.post@n5.nabble.com> <002801cfc1d4$143f1620$3cbd4260$@gmail.com> <001e01cfc260$d5d3f300$817bd900$@gmail.com> In-Reply-To: Subject: =?UTF-8?Q?=E7=AD=94=E5=A4=8D:_=5BJDBC=5D_invalid_byte_sequence?= =?UTF-8?Q?_for_encoding_=22UTF8=22:_0x00?= Date: Mon, 1 Sep 2014 10:04:24 +0800 Message-ID: <006001cfc589$1102c7a0$330856e0$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHbbJToTPNV19dJXmwoXYZcoAqG0wIfKB9eAjd0V2sBL/EjCwJX5QnCAc+lr2gB8gDPYAGyKbtsAcEMjo0BwlPklgDfeZwlA04jSzWbLB4uEA== Content-Language: zh-cn X-Pg-Spam-Score: -1.7 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Hi, Laurenz Albe! Thanks for all your help! I've understand. Thank you so much! Best Regards! Jasmine -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- =E5=8F=91=E4=BB=B6=E4=BA=BA: Albe Laurenz [mailto:laurenz.albe@wien.gv.at]= =20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2014=E5=B9=B48=E6=9C=8829=E6=97=A5 17= :58 =E6=94=B6=E4=BB=B6=E4=BA=BA: liuyuanyuan *EXTERN* =E4=B8=BB=E9=A2=98: RE: [JDBC] invalid byte sequence for encoding "UTF8": 0= x00 > Are there other error encoded Strings that I haven't catch? > If there other error encoded String occurs, maybe my program will catch e= xception again. > Is there a foolproof method that could resolve all problem caused by enco= ding ? 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 U= TF8, otherwise it may be that the server cannot store a valid character). Yours, Laurenz Albe --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin