RazorLight
RazorLight copied to clipboard
Special characters
Hello, I'm trying to send data with accent and special characters, but it's returning me the data in an incorrect way.
See my example, the result should be:
Olá - Olá
But it is returning:
Olá - Olá
My code:
public class TestModel
{
public string Name { get; set; }
}
public class Program
{
public static void Main(string[] args)
{
var model = new TestModel()
{
Name = "Olá"
};
var engine = EngineFactory.CreatePhysical(@"D:\");
string result = engine.ParseString("Olá - @Model.Name", model, model.GetType());
//=> "Olá? - Olá?"
}
}
Version: "RazorLight": "1.0.0"
Try to use @Raw() on your words that contain special characters (https://github.com/toddams/RazorLight/wiki/Encoding)