I have a PHP script that reads in data from an XML file, returns it via AJAX to a page which then places the data in to the relevant text area.
The Content-Type of the page is as follows:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
The XML heading looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY pound "£">
]>
...
The problem is that when the data arrives in the text box it has the character  before it.
I was under the impression that setting the content type to UTF-8 fixes this problem but I must be wrong. Can anyone tell me which encoding type I need to use to get it to render consistently?
The problem with character encoding is if some program or process, at any step, fails to deal with it correctly then characters can be munged.
So, you have
So, ideally, at every step, you want UTF-8 encoding. It’s likely at some step in the process your character is getting munged. Here’s the steps I’d take to track this down