470,874 Members | 1,573 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,874 developers. It's quick & easy.

Parsing UTF-8 string with XSLT

Hello, the majority of my sites use PHP MYSQL and XSLT for dynamic
pages and all of it works ok for English characters. The problem begins
when I try to use Romanian or Russian characters while creating the XML
string.

What I used to do is:
1) Query the MYSQL database that is UTF-8 (the conection is also set by
a query to UTF-8)
2) Create a XML string in PHP using the query results
3) Transform the XML string using a XSLT parser

As I said it all works ok with the English data but when I try using
Russian instead of letters I get question signs. If I try to echo the
Russian text when creating the XML data it is displayed correctly, so
the problem is in the XML string that is somehow not UTF-8 encoded or
what??

Can someone help me?

Feb 10 '06 #1
2 2041
Which version of PHP are you using? Which XML functions - DOM XML or XML?
Which xslt engine - Sablotron or XSL?

--
Tony Marston
http://www.tonymarston.net

<Be**********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hello, the majority of my sites use PHP MYSQL and XSLT for dynamic
pages and all of it works ok for English characters. The problem begins
when I try to use Romanian or Russian characters while creating the XML
string.

What I used to do is:
1) Query the MYSQL database that is UTF-8 (the conection is also set by
a query to UTF-8)
2) Create a XML string in PHP using the query results
3) Transform the XML string using a XSLT parser

As I said it all works ok with the English data but when I try using
Russian instead of letters I get question signs. If I try to echo the
Russian text when creating the XML data it is displayed correctly, so
the problem is in the XML string that is somehow not UTF-8 encoded or
what??

Can someone help me?

Feb 10 '06 #2
Thank you! I already found the problem. It is a validator class that
was just cutting all the Russian characters away from the string before
processing. I just didn't notice that in the first place. Sorry.

Feb 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Anders Eriksson | last post: by
5 posts views Thread by Aleksandar Matijaca | last post: by
10 posts views Thread by George | last post: by
4 posts views Thread by R Wood | last post: by
2 posts views Thread by ashmir.d | last post: by
13 posts views Thread by Phillip B Oldham | last post: by
1 post views Thread by Moistly | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.