From: | "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
---|---|
To: | "Daniel Schuchardt *EXTERN*" <d(dot)schuchardt(at)prodat-sql(dot)de>, <pgsql-general(at)postgresql(dot)org> |
Cc: | "Scott Ribe" <scott_ribe(at)killerbytes(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Thomas Kellerer" <spam_eater(at)gmx(dot)net> |
Subject: | Re: invalid byte sequence for encoding |
Date: | 2009-09-16 07:12:37 |
Message-ID: | D960CB61B694CF459DCFB4B0128514C203937F18@exadv11.host.magwien.gv.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Daniel Schuchardt wrote:
> but look here:
>
> XXXXX=# UPDATE art SET ak_auftxt= '*', ak_auftxt_rtf=
> '{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0
> Arial;}}\r\n\\viewkind4\\uc1\\pard\\lang1031\\fs20 *
> \r\n\\par }\r\n\0' WHERE ak_nr='TEST';
> WARNING: nonstandard use of \\ in a string literal at character 47
> HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
> ERROR: invalid byte sequence for encoding "SQL_ASCII": 0x00
> HINT: This error can also happen if the byte sequence does not match
> the encoding expected by the server, which is controlled by
> "client_encoding".
> XXXX=# SELECT version();
> version
> -------------------------------------------------------------
> PostgreSQL 8.4.1, compiled by Visual C++ build 1400, 32-bit
>
> ##############################################################
>
> XXXX=# UPDATE art SET ak_auftxt= '*', ak_auftxt_rtf=
> '{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0
> Arial;}}\r\n\\viewkind4\\uc1\\pard\\lang1031\\fs20 *\
> r\n\\par }\r\n\0' WHERE ak_nr='TEST';
> UPDATE 1
> XXXX=# SELECT version();
> version
> --------------------------------------------------------------
> PostgreSQL 8.1.11 on i486-pc-linux-gnu, compiled by GCC cc
> (GCC) 4.1.2
> 20061115
> (prerelease) (Debian 4.1.1-21)
> (1 row)
PostgreSQL's encoding checks have become more airtight over the
versions, so it is no surprise that buggy behaviour in 8.1
has changed by 8.4.
The zero character at the end of your string has been wrong all
along, only the old version does not complain.
You probably never noticed the string truncation because the
zero character is the last one.
You'll need to fix your program so that it does not emit trailing
zero characters.
Yours,
Laurenz Albe
From | Date | Subject | |
---|---|---|---|
Next Message | Ow Mun Heng | 2009-09-16 08:40:26 | Re: hardware information |
Previous Message | John R Pierce | 2009-09-16 02:53:53 | Solaris Postgres |