Yes! Thanks!

I actually got to the bottom of it shortly before I received this mail.

For the record and if it helps anybody else...

I was generating my input XML data from an SQL query on a MySql database.
The database is configured (well, it came out-of-the-box) as default
ISO-8859-1. I generate the XML using a perl script (XML::Generator::DBI
and XML::Hander::YAWriter), which defaults to UTF-8 encoding. Hence the
problem.

I only got away with it for as long as I did, because I must only have had
old-fashioned ASCII data in my tables. When I introduced some Norwegian
customers it all fell over.

It was simply a matter of telling YAWriter to encode ISO-8859-1 (and
changing the <?xml line appropriately) and all was well.

Thanks for everybody's help!

H.


> I encountered a similar error. The problem was that I was generating an
> XML document that contained non UTF-8 data but I incorrectly indicated
> that the document was UTF-8 in the prolog: <?xml version="1.0"
> encoding="UTF-8"?>. FOP encountered a non UTF-8 character (a foreign
> currency symbol in my case) and threw the same king of invalid byte
> sequence error.
>
> The solution is to change the document's encoding. When generating your
> output document, change the encoding to "ISO-8859-1" or whatever the
> proper encoding is for the kind of character data your document
> contains. E.g. <?xml version="1.0" encoding="ISO-8859-1"?>
>
> Note: I am using Castor's Marshaller to generate an XML document from
> JavaBeans and I had to tell it to use the proper encoding like this:
>
> marshaller.setEncoding( "ISO-8859-1" );
>
> -Steve
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 6:00 AM
> To: [EMAIL PROTECTED]
> Subject: UTF-8 errors
>
> Hi,
>
> When I run FOP, I get the following error...
>
> "Invalid byte 2 of 2 byte UTF-8 sequence"
>
> ...followed by an extensive trace.
>
> I have a pretty clear idea of what it mean but not what to do about it!!
> The following problems spring to mind...
> * What file is the invalid sequence in? Is it my xml (input) file or the
> xsl file?
> * Even if I identify the file, where/which character is causing the
> problem
> * how do I fix it :-)
>
> I guess what I am saying is that the error message is getting towards
> useless...
>
> Has anybody got any suggestions on how to proceed with this?
>
> Any help much appreciated
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to