When reading a source template, RazorGenerator currently uses `Encoding.Default`.
In `RazorHost.GenerateCode()`:
Stream stream = File.OpenRead(_fullPath);
using (var reader = new StreamReader(stream, Encoding.Default, detectEncodingFromByteOrderMarks: true))
{
results = engine.GenerateCode(reader, className: DefaultClassName, rootNamespace: DefaultNamespace, sourceFileName: _fullPath);
}
This can be easily tested by using the ellipsis (…) character in a template (ALT+0133), which gets transformed into:
WriteLiteral("�");
From Microsoft's [documentation][1] on `Encoding.Default`.
> Because all Default encodings lose data, you might use UTF8 instead.
[1]: http://msdn.microsoft.com/en-us/library/system.text.encoding.default%28v=vs.110%29.aspx
Comments: We'd be happy to take a PR for this :)
In `RazorHost.GenerateCode()`:
Stream stream = File.OpenRead(_fullPath);
using (var reader = new StreamReader(stream, Encoding.Default, detectEncodingFromByteOrderMarks: true))
{
results = engine.GenerateCode(reader, className: DefaultClassName, rootNamespace: DefaultNamespace, sourceFileName: _fullPath);
}
This can be easily tested by using the ellipsis (…) character in a template (ALT+0133), which gets transformed into:
WriteLiteral("�");
From Microsoft's [documentation][1] on `Encoding.Default`.
> Because all Default encodings lose data, you might use UTF8 instead.
[1]: http://msdn.microsoft.com/en-us/library/system.text.encoding.default%28v=vs.110%29.aspx
Comments: We'd be happy to take a PR for this :)