Skip to main content.
home | support | download

Back to List Archive

Error '1' converting internal UTF-8 to Latin-1

From: Michael Peters <mpeters(at)>
Date: Tue Nov 30 2004 - 14:14:09 GMT
hello all,

I've been using swish-e for a while now and have not seen this come up 
before. I'm trying to run existing code on a new setup and it works 
without any problems, but I keep getting this warning on indexing...

     Error '%d' converting internal UTF-8 to Latin-1

It always seems to happen on the '<' character, but not every '<' 
character, just most. I know swish-e is using libxml2 to parse the 
templates and it can't use UFT8 so it has libxml2 convert it to Latin1. 
The warning message comes from parser.c line 899 because the return 
value of the libxml2 function UTF8Toisolat1() is not returning a '0' 
value but some other positive value (usually '1').

Now according to this

it seems that if UTF8Toisolat1() returns a positive value it means that 
it's still valid and refers to the number of octets consumed. Should 
this emit a warning in this case?

The problem is that my test suite passes and everything works, but the 
test suite output is garbled by the output of the indexing script that 
gets run before a certain group of tests.

If I change parser.c 871 from
     if ( ret == 0 )         // all done
     if ( ret >= 0 )         // all done

then everything works just fine. Any suggestions? Does this break 
anything else? Also, the old setup was using libxml2 version 2.6.8 and 
the new setup has 2.6.16 if that helps.

Michael Peters
Plus Three, LP
Received on Tue Nov 30 06:14:16 2004