RazorLight icon indicating copy to clipboard operation
RazorLight copied to clipboard

Special characters

Open williamwmd opened this issue 9 years ago • 1 comments

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"

williamwmd avatar Apr 06 '17 20:04 williamwmd

Try to use @Raw() on your words that contain special characters (https://github.com/toddams/RazorLight/wiki/Encoding)

toddams avatar Apr 06 '17 20:04 toddams