Search code examples
c#cyrillic

Problems with input when writing other languages in C#


class Exercise
{
    static void Main(string[] args)
    {
        String a = Console.ReadLine();
        int b = int.Parse(a);

        if (b % 2 == 0)
        {
            Console.WriteLine("Числото а е четно" );
        }
        else
        {
            Console.WriteLine("Числото е нечетно");

        }
    }
}

I am unable to enter text in my own languages. Is there a way to import a library or something that can read letters appart from English ones? See the input of the screenshot.

UTF-8 format uses that Cyrillic alphabet.

screenshot


Solution

  • I found it ! Sorry for the spam! I have to add this line to my code.

    Console.OutputEncoding = Encoding.UTF8;