You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Peter Sørensen <ma...@sdu.dk> on 2008/06/19 09:25:01 UTC

Invalid byte sequence for encoding

Hi,

I am in the process of converting bayes from mysql to postgres.
On my running system I make a backup with

# sa-learn --backup > /tmp/bayes.backup

I use this file as input on my redhat ( 2... ) testsystem using spamassassin 3.4.4
and postgres 8.3.1 like:

# sa-learn --restore bayes.backup



I get the following error:

 ............bayes: seen (023it$1m065r4g57g6m$j8-6@jw5.q.3jr4u) put 
[16119] dbg: bayes: seen (023l-0lq-$c29@dy8il.a.9.1b) put 
[16119] dbg: bayes: seen (023u96$gy--11$hud029-cjvq@l9a.6.d5.1.0q1) put
[16119] dbg: bayes: seen (024-1$oh$$2x$j0m@5n4mty7um4) put
[16119] dbg: bayes: seen (024001c36025$e8a46f21$b400a8c0@servidor) put
[16119] dbg: bayes: seen_put: SQL error: ERROR: invalid byte sequence for encoding "UTF8": 0xd3ce
[16119] dbg: bayes: 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".
[16119] dbg: bayes: error inserting msgid in seen table for line: s s 024001c3643b$71a03ab0$b400a8c0@ÓÎÏòÑô
bayes: encountered too many errors (20) while parsing seen lines, reverting to empty database and exiting
ERROR: Bayes restore returned an error, please re-run with -D for more information

I could of course try and find the offending lines in the file and delete but 
I'm not sure if this an error that will persist. Any hints?


Regards


Peter Sorensen/University of Southern Denmark/email: maspsr@sdu.dk


Re: Invalid byte sequence for encoding

Posted by Michael Monnerie <mi...@it-management.at>.
On Donnerstag, 19. Juni 2008 Peter Sørensen wrote:
> [16119] dbg: bayes: seen_put: SQL error: ERROR: invalid byte sequence
> for encoding "UTF8": 0xd3ce [16119] dbg: bayes: 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".

I guess you had encoding SQL_ASCII on mysql and use UTF8 on postgresql? 
Then you may have to let iconv parse the /tmp/bayes.backup into utf8, 
and import that.

mfg zmi
-- 
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0660 / 415 65 31                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38  500E CE14 91F7 1C12 09B4
// Keyserver: www.keyserver.net                   Key-ID: 1C1209B4

Re: Invalid byte sequence for encoding

Posted by Benny Pedersen <me...@junc.org>.
On Thu, June 19, 2008 09:25, Peter Sørensen wrote:

> [16119] dbg: bayes: seen_put: SQL error: ERROR: invalid byte sequence for
> encoding "UTF8": 0xd3ce
> [16119] dbg: bayes: 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".

use latin in postgresql will solve it


Benny Pedersen
Need more webspace ? http://www.servage.net/?coupon=cust37098