'in another language, text typed in console is not the same as the text in the code

I'm trying to ask for input from the console in Hebrew and then compare it to a premade table. Problem is for some reason the text from the console and what i typed in the code aren't the same.

through testing i found that with the following code, if i type א in console, it returns no. Why does it do this and how do i fix it?

string t = Console.ReadLine();
if (t == "א")
{
    Console.WriteLine("yes");
}
else { Console.WriteLine("no"); }


Solution 1:[1]

using System.Text;

Console.InputEncoding = Encoding.Unicode;
Console.OutputEncoding = Encoding.Unicode;

string t = Console.ReadLine();
if (t == "?")
{
    Console.WriteLine("yes");
}
else
{
    Console.WriteLine("no");
}

Worked for me copy/pasting ? in.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matt Searles