472,127 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Encoding problem

I have a dom tree representing the content of a html document. In the xml I
use € as the euro sign. I think I need to do this to be able to use
xsl transformations. After the xsl transformation I use a small SAX
parser. But my € gets converted to: â,¬50.
I've tried passing xml_parser_create() 'UTF-8' and '' (hint from php.net)
but it only makes things worse ( ? or squares are displayed ).
How do i have to encode characters to be able to pass them to SAX. Is there
a build in function or do I use str_replace()?

Rutger Claes
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
The soul would have no rainbow had the eyes no tears.

Jul 17 '05 #1
3 2426
Rutger Claes wrote:
I have a dom tree representing the content of a html document. In the xml I
use € as the euro sign. I think I need to do this to be able to use
xsl transformations. After the xsl transformation I use a small SAX
parser. But my € gets converted to: â,¬50.
I've tried passing xml_parser_create() 'UTF-8' and '' (hint from php.net)
but it only makes things worse ( ? or squares are displayed ).
How do i have to encode characters to be able to pass them to SAX. Is there
a build in function or do I use str_replace()?

Rutger Claes


Why not just use € ?

--
Jason Morehouse
Vendorama - The evolution of e-commerce
http://www.vendorama.com
Jul 17 '05 #2
Jason Morehouse <jm@rm.spam-vendorama.com> wrote:
I have a dom tree representing the content of a html document. In the xml I
use &#x20AC; as the euro sign.


Why not just use &euro; ?


That is not one of the 5 default character entities in XML. It's only
valid when defined in a DTD.

No direct answer to the OPs question, but if the encoding of the XML is
either iso-8859-15 or UTF-x there is no need to encode the EUR symbol.

Jul 17 '05 #3
Daniel Tryba wrote:
Jason Morehouse <jm@rm.spam-vendorama.com> wrote:
I have a dom tree representing the content of a html document. In the
xml I use &#x20AC; as the euro sign.


Why not just use &euro; ?


That is not one of the 5 default character entities in XML. It's only
valid when defined in a DTD.

No direct answer to the OPs question, but if the encoding of the XML is
either iso-8859-15 or UTF-x there is no need to encode the EUR symbol.


It's not really important what encoding I will use.**It's*just*that*if*I
don't use &#x20AC; I get errors from my XSL transformation.
I just need a way to get through XSL and then through SAX.**If*I*can*use*the
same symbol, great.**If*I*have*to*do*a*str_replace*then*I*just* need*to*know
from &#x20AC; to what...

Can I use a <?xml encoding="" ?> or something in my XSL transformation so
that I can use another symbol then &#x20AC; that is also usable in SAX.

*Thanks*for*the*answers,*sorry*for*the*english
*
**Rutger*Claes
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Computers are useless. They can only give you answers.
-- Pablo Picasso

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ann | last post: by
8 posts views Thread by davisjoseph | last post: by
8 posts views Thread by Demon News | last post: by
4 posts views Thread by fitsch | last post: by
23 posts views Thread by Allan Ebdrup | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.