By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

Encoding problem

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.