I am developing a site that will be in both Chinese and English. I am dynamicly putting content on to the page with the use of xml files. In the xml the chinese characters are encoded like 第 . The issue I am having is that when I pull this out of the xml, php encodes it to the symbol and puts it on the page. I don't want the symbol I want the html ascii that creates the symbol to print. This way the chinese and english can exist on the same page without trying to find a encoding type. If I encode for Chinese the English fonts are messed up and if I do it the other way the chinese is messed up. If I can get the 第 to print on the page they both look perfect.
hope someone can help with this
Just a note after submiting this the ascii codes got converted to symbols. the ascii code should be "& # 3 1 5 3 2 ;" without spaces of course.
Having issue getting html ascii out of xml file
Moderator: General Moderators
I hope htmlspecialchars() will work for you.
Having issue getting html ascii out of xml file
I had tried that and got the same results. for some reason when php reads the xml file it just converts the ascii to the symbol. I have also tried encode, decode, and htmlentities. the xml can be found at http://www.tomspeaksenglish.com/xml/Chinese.xml. The browser displays the symbols but when you view source it shows the ascii. The webpage is at http://www.tomspeaksenglish.com/index-dev for enlish and http://www.tomspeaksenglish.com/index-dev?lan=Ch. If you view source on the web page in a non-chinese enabled editor you get lots of messed up characters, but it you have a chinese enabled editor like emeditor you will see the actual characters.