Re: [xep-support] UTF data format

From: Mike Trotman <mike.trotman@datalucid.com>
Date: Mon May 02 2005 - 08:14:51 PDT

As you XML file seems to be plain and correct UTF8 my guess is that your
XSLT transformation is adding non-UTF8 characters
and you are also not specifying the encoding of the output FO XML.
(hard to check quickly as the XSLT doesn't contain any line breaks)

You probably need to specify the correct encoding for what you are
entering in the XSLT
(and use an <xsl:output> element to specify the encoding to be output)
It might also be safer to use Unicode character entity specifications of
your characters so that they get output correctly
i.e. that they DO specify the character that you want)

Whatever you do - don't hack about with the bytes in an XML file!

Mike

Duncan, David wrote:

>Hi,
>
> I am having a bit of difficulty in rendering any documents with a
>particular character in the XSLFO. The accented A character throws the
>following exception when using CLISER to perform the PDF rendering,
>
> Invalid byte 2 of 2-byte UTF-8
>sequence.java.io.UTFDataFormatException: Invalid byte 2 of 2-byte UTF-8
>sequence.
>
>I have tried varies things such as specifying UTF-8 encoding when I am
>converting between streams and strings, e.g. fo.getBytes("UTF-8").
>
>I have also tried some character conversions using code like (although I
>want to avoid this sort of thing for performance reasons),
>
>
> if (chVal > Byte.MAX_VALUE) {
>
>encodedData.append("&#x").append(Integer.toHexString(chVal)).append(";");
> } else {
> encodedData.append(ch);
> }
>
>It seems that I can get the PDF to render by trying combinations of these
>methods, but the characters always appear strange. We have bullet points and
>pound/euro symbols that start appearing as question marks if I start playing
>around with encoding. Can someone provide any advice on what the best
>approach should be to solve this problem?
>
>Incase this is helpful, I have attached an XML, XSL and XSLFO file that is
>causing the problem. The particular line in the XSLFO is,
>
><fo:block text-align="left">@K2ADD1:10 ?rd na Mara</fo:block>
>
>Im not sure if this is important but the Address field with the problematic
>character comes from the source XML file. Other special characters I use
>(like bullet points) seem to work fine, but are coded into the XSL template
>and not the XML. Maybe the XALAN transform is doing something strange? The
>attached XSLFO file is a direct print out after the XSL transform is done
>and the FO transferred to the CLISER service. Any advice would be
>appreciated.
>
>Thanks for you help,
>
>David D.
>
>-----Original Message-----
>From: owner-xep-support@renderx.com
>[mailto:owner-xep-support@renderx.com]On Behalf Of David Tolpin
>Sent: 02 May 2005 12:05
>To: xep-support@renderx.com
>Subject: Fwd: [xep-support] Strange behaviour in XEP Assistant
>
>
>Hi Richard,
>
>my apologies for the wrong name in the e-mail I've just sent.
>
>David
>
>-------------------
>(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
>in the body of the message to majordomo@renderx.com from the address
>you are subscribed from.
>(*) By using the Service, you expressly agree to these Terms of Service
>http://www.renderx.com/tos.html
>
>
>
>
>-----------------------------------------
>Information in this email may be privileged, confidential and is intended
>exclusively for the addressee. The views expressed may not be official
>policy, but the personal views of the originator. If you have received it
>in error, please notify the sender by return e-mail and delete it from your
>system. You should not reproduce, distribute, store, retransmit, use or
>disclose its contents to anyone. Please note we reserve the right to
>monitor all e-mail communication through our internal and external
>networks.
>
>

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.0 - Release Date: 29/04/2005
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
Received on Mon May 2 09:08:39 2005

This archive was generated by hypermail 2.1.8 : Mon May 02 2005 - 09:08:39 PDT