Re: invalid byte sequence for encoding - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: invalid byte sequence for encoding
Date
Msg-id 1252880506.26439.29.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: invalid byte sequence for encoding  (Daniel Schuchardt <d.schuchardt@prodat-sql.de>)
Responses Re: invalid byte sequence for encoding
List pgsql-general
On sön, 2009-09-13 at 22:21 +0200, Daniel Schuchardt wrote:
> First:In Postgres81 everything is working fine.

In general, older versions of PostgreSQL treated encoding issues much
mroe loosely, which subsequently lead to user errors, bugs, and
confusion.  Later versions are more strict.  Therefore, experience
dictates that "$oldversion is working fine" often really means "your
application code was abusing definitional gaps and bugs".

> (((with our parser:
> 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 dbrid=204800
> ))))

At the very least, you should escape the \0 to \\0.  And then put E''
around the string.  The answer recommended elsewhere to set
standard_conforming_strings to true will also work, but might break
other code that you have currently running.  Read its documentation
carefully.


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: invalid byte sequence for encoding
Next
From: Grant Maxwell
Date:
Subject: Re: "show all" command crashes server *** FIXED ***