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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.