I have a VirtualPathProvider which takes source code from my DB as a plain string and encodes it as UTF8.
For example:
public override Stream Open()
{
MemoryStream result = new MemoryStream();
result = new MemoryStream(Encoding.UTF8.GetBytes(_sourceCode));
return result;
}
I then have a layout master page which has its charset as UTF 8
<meta charset="utf-8">
The master page then calls @RenderBody()
which gets my VirtualPathProvider page and outputs it to the browser.
The problem is that it is outputting the page with its encoded characters:
wünschte becomes wünschte
What am I doing wrong?
TLDR:
I want wünschte to display instead of wünschte. The plain string from the DB is wünschte, but once it comes from the memory stream onto my page it becomes wünschte.