zzzprojects / Eval-Expression.NET

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.
https://eval-expression.net/
Other
459 stars 86 forks source link

Unicode chars are not handled in member names #27

Closed rodro75 closed 6 years ago

rodro75 commented 6 years ago

Hello guys,

I've found that the library thows an exception when it encounters member names containing accented letters, like in the following unit test.

[TestMethod]
public void CanHandleUnicodeMemberNames()
{
    var context = new EvalContext { UseCache = false };
    var code = @"Quantità == 10";
    var dataContext = new {Quantità = 10};
    var result = context.Execute(code, dataContext);
    Assert.IsTrue(result);
}

Given that c# allows for unicode characters in member names I didn't expect this behavior.

Thanks!

JonathanMagnan commented 6 years ago

Hello @rodro75 ,

Thank you for reporting. You are right, our library doesn't support accent.

We will look at the code this week and evaluate the complexity of implementing that this week.

Best Regards,

Jonathan

JonathanMagnan commented 6 years ago

Hello @rodro75 ,

The v2.4.15 has been released.

Accent should now be supported for a variable name.

Let me know if that works correctly.

Best Regards,

Jonathan

rodro75 commented 6 years ago

Hey @JonathanMagnan ,

I confirm that the issue is gone 👍

Thank you very much for the rapid fix, you saved the day!

Bye,

-Rodro-