Having a problem with special characters

Hello,

I have a SWF that gets its text from an external html file. Our style guide is very specific, it requires that characters such as quotes (’) be left and right specific.

The code in the html file for a right quote is:


&rsquo

The problem is that Flash is not rendering this code as a right hand quote. It actually appears as ‘&rsquo’

Here is some of the AS3 code.


/********* Load the HTML file. ***************************************************************************************/
var loadHTMLFile:String = popUrl;// Get the URL for the HTML file
var loadedHTMLFile:String;// Variable to store the HTML data
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, handleHTMLLoad);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);


function handleHTMLLoad(evt:Event):void
{
 txtTitle.text = pupTitle;
 mcPopup.txtContent.htmlText += "In the handleHTMLLoad function";
 
 loader.removeEventListener(Event.COMPLETE, handleHTMLLoad);
 loadedHTMLFile=String(evt.target.data);
 var rex:RegExp = /[
]*/gim; 
 loadedHTMLFile = loadedHTMLFile.replace(rex,'');
 loadedHTMLFile = loadedHTMLFile.replace(/\s{1,}(.*?)/g, "$1 ");
 
 mcPopup.txtContent.htmlText = "
" + loadedHTMLFile;
 
 //ExternalInterface.call("swfIsReady");
 //extInterface("swfIsReady");
}