Jump to content

Will Html Entities Prevent Character Encoding From Corrupting Content?


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...