Jump to content

unicode with dom parser


BlackenedSky

Recommended Posts

Hi,

 

I'm having trouble displaying unicode characters correctly when using the DOM parser to display strings on the page. Is there any way to get it to display them correctly, or alternatively a built in php function to replace them all with the HTML code version when saving to the database.

 

I have a php function pulling information from a database, and generating an xml document. Characters are being preserved in the database and displayed correctly when not using xml and parsing it.

However, characters such as the Euro sign, ñ é etc are not displaying when parsed, just a square character (Pe�br />)which is then in turn screwing up any HTML elements after it.

 

It is vital that I can support them as it is a website in Spanish, and an accent can be applied to ANY character, and the ñ,Ñ characters are common too. However, I got around the Euro sign problem using the HTML character code. As you can imagine it's not really feasible to create a function replacing them all with HTML codes as there is a huge range!

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/44914-unicode-with-dom-parser/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.