I use ServiceStack (v3.9.44.0) as a Windows service (targeting .Net4.5) and I use Razor so that ServiceStack generates and serves HTML.
Everything works very well, but there is a strange problem: it seems that the hardcoded unicode lines in the .cshtml view .cshtml not displaying properly.
Here is what I mean:

The structure of project representations is canonical:

From _Layout.cshtml is:
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <p>Accents in \Views\_Layout.cshtml: à é ë ô</p> @RenderBody() </body> </html>
and Articles.cshtml :
@inherits ViewPage<List<PrepaService.Article>> <p>Accents in \Views\Articles.cshtml: à é ë ô</p> Table with code-injected list of items: <table> @foreach(var a in Model) { <tr> <td>@a.Description</td> </tr> } </table>
Both files are correctly saved as UTF8 files containing no data.
I also tried adding the following, but didn't change anything:
SetConfig(new EndpointHostConfig { AppendUtf8CharsetOnContentTypes = new HashSet<string> { ContentType.Html } });
So, to do the following:
I use BOM-less UTF8 encoding for all files and explicitly determine the content type charset=utf-8 .
this works for everything that is displayed in _Layout.cshtml and everything that is entered by the code inside the viewing templates
but does not work for hard-coded strings in view templates .
References:
source share