Skip site navigation (1) Skip section navigation (2)

Re: invalid byte sequence for encoding "UTF8": 0x00

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Ken Johanson <pg-user(at)kensystem(dot)com>
Cc: James Im <im-james(at)hotmail(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00
Date: 2007-02-22 08:54:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-adminpgsql-jdbc
Ken Johanson wrote:

> At least on other servers/drivers I believe nulls are supported (and 
> should be according to some spec) (The only special-meaning char is 
> single quote).

The driver can't do anything about it, it's a server issue. I can think 
of some ways the server could support it without extensive changes .. 
e.g. use a "modified UTF8" representation which stores \u0000 as 0xc0 
0x80 internally .. but you'd have to take that up with the backend 

> I'm wondering how the binary protocol works insofar as handling the NULL 
> byte; does it precede it with a backslash?

The driver sends string parameters out-of-line without escaping (i.e. 
length field, then raw utf-8 data). The error you see is generated when 
the server notices that there's a \u0000 there; it rejects the string 
entirely rather than silently mangling it.


In response to

pgsql-admin by date

Next:From: Doug KnightDate: 2007-02-22 14:24:59
Subject: UIDs/GIDs for hacluster and haclient
Previous:From: Andy Shellam (Mailing Lists)Date: 2007-02-22 08:43:13
Subject: Re: [pgadmin-support] UNSUBSCRIBE

pgsql-jdbc by date

Next:From: Heikki LinnakangasDate: 2007-02-22 10:58:03
Subject: Re: Class Cast Exception for DataSource
Previous:From: Ken JohansonDate: 2007-02-22 06:37:51
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group