I'm working on a viewer to display xml log files as html using xslt. Everything is going fine exception my localization. The resulting HTML file has a 'Ã³' where some double byte characters should be. I can't figure out what I am doing wrong.

Here is a a stripped down XSLT file:

```
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions">

  <xsl:output method="html" version="4.0" encoding="utf-8" indent="yes"/>

  <xsl:variable name="language" select="nbklog/@language" />  
  <xsl:variable name="dictionaryName">
    dictionary_<xsl:value-of select="$language"/>.xml
  </xsl:variable>
  <xsl:variable name="dictionary" select="document($dictionaryName)" />

  <xsl:template match="/nbklog">
    <html>
      <body>          
        <h2>       
          <xsl:value-of select="$dictionary//String[@Key=$jobType]" /> 
        </h2>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

```

Here is a dictionary xml file used for localization:

```
<?xml version="1.0" encoding="utf-8"?>
  <Dictionary xml:lang="es-ES">
    <String Key="Application">
      Applicación
    </String>
  </Dictionary>

```

Here is an example xml file to be transformed:

```
<?xml version="1.0" encoding="utf-8"?>
<nbklog id="51b654d4" jobType="backup" language="es-ES" version="1.0">
    <deviceName>c:\</deviceName>
    ....
</nbklog>

```

I'm executing the transformation the following c# code:

```
 string theOutputHtml;

 using (MemoryStream ms = new MemoryStream()) {
     using (XmlTextWriter writer = new XmlTextWriter(ms, Encoding.UTF8)) {

         XPathDocument theDocument = new XPathDocument(inXmlFilename);

         // Load the style sheet and run the transformation.
         XslCompiledTransform theXslTrasform = new XslCompiledTransform();
         theXslTrasform.Load(inXsltFilename, XsltSettings.TrustedXslt, null);
         theXslTrasform.Transform(theDocument, writer);

         ms.Position = 0;

         using (StreamReader theReader = new StreamReader(ms)) {
             theOutputHtml = theReader.ReadToEnd();
         }
     }
 }

```

The content of theOutputHtml will have a 'Ã³' instead of the 'ó'.

**EDIT:**

Adding this between the and tags in the html string solved my problem:

```
 <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'>

```