Re: invalid byte sequence for encoding

From: Daniel Schuchardt <d(dot)schuchardt(at)prodat-sql(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: invalid byte sequence for encoding
Date: 2009-09-13 20:21:09
Message-ID: h8jk7g$2sma$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

First:In Postgres81 everything is working fine.

Second:string:Not really: thats the orignal string, and its a string:
(http://de.wikipedia.org/wiki/Rich_Text_Format)
(http://en.wikipedia.org/wiki/Rich_Text_Format)

{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Arial;}}
\viewkind4\uc1\pard\lang1031\fs20 *
\par }

you can save it in a textfile and open it with MS-Word or OpenOffice.

without our own parser its looking in that way:

UPDATE art SET ak_auftxt= '*', ak_auftxt_rtf=
'{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Arial;}}
\viewkind4\uc1\pard\lang1031\fs20 *
\par } ' WHERE dbrid=204800

(((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
))))

WARNING: nonstandard use of escape in a string literal
LINE 1: UPDATE art SET ak_auftxt= '*', ak_auftxt_rtf= '{\rtf1\ansi\d...
^
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
Abfrage war erfolgreich durchgeführt: 1 Zeile, 203 ms Ausführungszeit.

Peter Eisentraut schrieb:
> On sön, 2009-09-13 at 18:51 +0200, Daniel Schuchardt wrote:
>> UPDATE belzeil_frei SET bz_zubez= '*', bz_zubez_rtf=
>> '{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0
>> Arial;}}\r\n\\viewkind4\\uc1\\pard\\lang1031\\fs20 *\r\n\\par }\r\n\0'
>> WHERE dbrid=295116
>>
>> Result : ERROR: invalid byte sequence for encoding "WIN1252": 0x00
>>
>> In that example i try to insert a "*" with rtf-encoding.
>>
>> i have the same problem with SQL_ASCII
>
> Maybe you want to use the bytea type instead, because you appear to be
> storing bytes rather than characters.
>
>

--
Daniel Schuchardt
/Softwareentwicklung/

www.prodat-sql.de

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Schuchardt 2009-09-13 20:24:12 Re: invalid byte sequence for encoding
Previous Message Scott Ribe 2009-09-13 19:48:24 Re: invalid byte sequence for encoding