views:

455

answers:

1

I have an HTML file with a ® (copyright) and ™ (trademark) symbol in the text. These are just two among many other symbols. When I read the html file into a literal control it converts the symbols to something else.

The copyright symbol converts to � (open box in ff) The trademark symbol converts to ™ (as expected)

If (System.IO.File.Exists(FullName)) Then
   Dim StreamReader1 As New System.IO.StreamReader(FullName)
   Contents.Text = StreamReader1.ReadToEnd()
   StreamReader1.Close()
End If

Contents is a <asp:Literal runat="server" ID="Contents"></asp:Literal> and it's the only control in the aspx page.

From some research I think this is related to the encoding but I don't know why it would change how to fix it.

The html file does not contain any Content-Type settings in the head section.

A: 

If it's at all possible to shift this processing to the Render method, you could use HttpResponse.WriteFile to see if it handles these characters better than the Literal control does. If you're doing nothing with the content of this file other than assigning it to the control and then letting it render, then you should be able to do this OK.

sliderhouserules