How to achieve correctly encoded output with scriptcs?

55 Views Asked by At

I'm trying to write cyrillic symbols to output:

// scr.csx
using System;
Console.WriteLine("asd ПРИВЕТ");

But it is not displayed as expected when I run it:

> scriptcs scr
asd ??????

I've tried to save scr.csx in different encodings, it does not help.

1

There are 1 best solutions below

0
Devin L. On BEST ANSWER

Add this line before outputting:

Console.OutputEncoding = System.Text.Encoding.UTF8;