Can you post your small script? Can you post the relevant parts of the raw html you scrape? Specifically, if it specifies what encoding it is using and the exact html of the test in question to see how it has those characters. Also, what database is this? I think that the text you're showing us is from taking the XXX-type characters from the html and shoving it into your YYY database, so to figure out the problem and see where to put the solution, need to back up and separate out the steps...