We have separated teams for front end and back end work. The front end is using a large diversity of editors to edit the CSHTML
and most of them save UTF-8
without a byte order mark. The problem is, Razor expects a BOM
to be present. If it's not present it will read the file using the current code page and we get encoding problems.
How would I make Razor to accept the UTF-8
files without a BOM
? Apparently the only solution would be to implement an own VirtualPathProvider
and thus also a VirtualFile
. Unfortunately, the current used VirtualPathProvider
is MapPathBasedVirtualPathProvider
, which is an internal class. So I'd have to re-create a lot of functionality.