Jump to content

Will Html Entities Prevent Character Encoding From Corrupting Content?


hknight

Recommended Posts

Sometimes characters like £ and ® are not displayed correctly if there is a mismatch between the character encoding used to save a file and the character encoding the server sends in the headers to a browser.For example, sometimes a graphic designer sends me the design and content for a website in photoshop or some other format. I code the website based on their specifications in valid HTML or XHTML. I save the html code using UTF-8 encoding or ANSI or whatever other format they specify and then I delver the code to them. If they upload the files I send to a server uses a different encoding (sent to the browser in the headers) then the encoding I saved the file in, extra boxes, question marks or symbols like  are displayed.I realize that the problem could be solved if the server was properly configured however these settings are out of my control after I deliver files to my client and ultimately they usually end up blaming me even though the problem is caused by their server.If I make sure that all non alphanumeric characters are converted into HTML entities could this problem be completely avoided?I could use the PHP function htmlentities () to help me before delivering the HTML files to my clients.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...