hknight Posted February 13, 2009 Share Posted February 13, 2009 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 More sharing options...
Ingolme Posted February 14, 2009 Share Posted February 14, 2009 HTML entities should work.You could run the htmlentities() function, or just put the entities themselves on the page to save server-side processing time.Here's the HTML entities reference:http://w3schools.com/tags/ref_symbols.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.