Jump to content

html entities garbled before conversion


frankvw

Recommended Posts

Quick one: I'm entering text in a form and after submission I run the form contents through htmlentities(). This used to work fine, but all of a sudden an e-acute in the form comes out as Ä©

 

Apparently the data is garbled before it goes into htmlentities(). This occurs on different webservers with different browsers. I'm suspecting some character encoding issue, but I'm not sure where to look for a solution.

 

Any pointers into the right direction would be greatly appreciated!

 

// saybibi("Frank\n");        // Sign off

Link to comment
https://forums.phpfreaks.com/topic/41944-html-entities-garbled-before-conversion/
Share on other sites

It is most likely the character encoding of your page.  My assumption is that you're probably using UTF-8 on your page.  UTF-8 is great, and is widely supported, but if you want any special characters, you're going to have to look into the ISO series, maybe ISO-8859-1

Thanks for the suggestion. However it didn't make any difference. My page header now says:

 

<meta http-equiv="Content-Type" content="text/html charset=ISO-8859-1" />

 

but the problem remains. I put in an e-acute which comes out as Ä©.

 

I'm not sure what's going on, as I've processed form output with PHP before and this never happened.

<scratches head>

 

saybibi("Frank\n");        // Sign off

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.