You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by John Brown <jo...@hotmail.com> on 2008/07/09 14:11:46 UTC

RE: Problem with Asian Language fonts

"Rakesh Kumar S" wrote:
>
> Hi Guys,
[snip]
>
> My problem is that the characters are appearing as encoded text in the PDF also. I am using UTF-8 encoding.I am using Arial Unicode MS Font that allows Asian language fonts.
> Please find the PDF attached.
> Could someone guide me how to overcome this problem.
>

Looking at candidade.xml.txt, I see that you have:
������/����Ԓ

I believe that this should be
������/����Ԓ

Hmm, the browser or Hotmail has magically replaced the text that I typed
with the chinese/japanese/korean/whatever characters, but I simply wanted
to say don't use &. Write & followed by #nnnnn.

When you write & you are saying that you want the literal symbol "&",
and you do not want the & to be treated as a special symbol, i.e., part of a
character entity. Therefore you end up with "&" followed by "#21271"
instead of the character that �� represents.


_________________________________________________________________
Making the world a better place one message at a time.
http://www.imtalkathon.com/?source=EML_WLH_Talkathon_BetterPlace

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem with Asian Language fonts

Posted by Abel Braaksma <ab...@xs4all.nl>.
Rakesh Kumar S wrote:
> Thanks a lot John...
> it worked fine...
>
> Now should i do this conversion every time ...
> Because XML stores this as &amp; but i need this as & while converting as PDF

XML does not store anything (XML is a meta language and does not have 
actions on its own). Your problem is either when you store it to the 
database (you say that you escape the data) or when you retrieve it back 
(using Castor, as you stated in your original question). At some point, 
you have a character, say "€" (euro symbol), it gets escaped to &#128;, 
which gets escaped to &amp;#128; (a second escape which is not proper). 
It may even be escaped one more time, storing it in the database as 
&amp;amp;#128;.

To get out of this mess do the following:

1. Always check your data using a text editor (DO NOT USE A BROWSER TO 
VIEW XML!)
2. Make sure you do not escape at all anymore (!!!)
3. Before storing it in the database, use XSLT (or a tool) to store the 
XML as XML with encoding "US-ASCII", this will effectively escape all 
higher characters (above ASCII 127).
4. When retrieving it from the database, either do nothing (use the XML 
with the encoding US-ASCII should be just fine to Apache FOP or any 
other XML capable process), or transform it to XML with encoding UTF-8 
for readability. Most (XSLT/tool) processors will remove the entities to 
their UTF-8 character counterparts, but they are not required to do so!

Regardless: do not escape by hand, only use XML tools and set the 
encoding to something your database can store. That way, you do not have 
to worry about silly double / triple up or down conversions.

HTH,

Cheers,
-- Abel --

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Problem with Asian Language fonts

Posted by Rakesh Kumar S <Ra...@infosys.com>.
Thanks a lot John...
it worked fine...

Now should i do this conversion every time ...
Because XML stores this as &amp; but i need this as & while converting as PDF

________________________________________
From: news [news@ger.gmane.org] On Behalf Of John Brown [johnbrown105@hotmail.com]
Sent: Wednesday, July 09, 2008 6:23 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Problem with Asian Language fonts

My XML is being totally scrambled. I meant to write:

Don't use the chararcter entity "& a m p ;", which means that
you want a literal ampersand character to appear in the output.

That is, instead of "& a m p ; # 2 1 2 7 1 ;", write "& # 2 1 2 7 1 ;"



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem with Asian Language fonts

Posted by John Brown <jo...@hotmail.com>.
My XML is being totally scrambled. I meant to write:

Don't use the chararcter entity "& a m p ;", which means that
you want a literal ampersand character to appear in the output.

That is, instead of "& a m p ; # 2 1 2 7 1 ;", write "& # 2 1 2 7 1 ;"



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org