How to use non-latin characters with ScriptSharp

728 Views Asked by At

I am trying to write:

options.Title = "Русский текст";

and in compiled JS i am getting:

options.title = '\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd';

So all characters in the title are replaced with '\ufffd'. And i am getting "??????? ?????" instead of "Русский текст" into markup.

1

There are 1 best solutions below

0
On BEST ANSWER

Try saving your source file (.cs) with another encoding like UTF-8 with signature (Codepage 65001). You can find this option under File -> Advanced Save Options in Visual Studio. This works for me with Turkish characters. Seems like ScriptSharp doesn't play well with single byte encodings.