Reading file to include in ASPX page drops characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main ASPX page that loads HTML pages into it.
If the HTML page contains characters like the (R) registered or (C) or apostrophe then these characters are replaced (usualy with a question mark) or dropped.
How can I retain these characters?

Thanks for you help
 
* "=?Utf-8?B?VGVnbw==?= said:
I have a main ASPX page that loads HTML pages into it.
If the HTML page contains characters like the (R) registered or (C) or
apostrophe then these characters are replaced (usualy with a question
mark) or dropped.
How can I retain these characters?

What encoding do you use for this/these page(s)?
 
* "=?Utf-8?B?VGVnbw==?= said:
I am not sure, I am very inexperienced with encoding terminology.
The page I am including is a simple HTML page (starts off with <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">)
It simply has this in its body tags:
<body>This is text from the HTML page.® fadsfasd</body>
When displayed inside the ASPX, it drops the (R) and replaces with different characters.
I tried a dynamic include, tried to use system.io to readstream and display it in a literal, still same result.

When using a 'StreamReader' to read the file, did you test it with
different encodings? The ctor of 'StreamReader' takes an 'Encoding'.
So try to read the file with 'System.Text.Encoding.Default' and other
encodings.
 
Back
Top