Found on the Internet this snippet. For some reason, I have questions in the results.
var unicodeString= "Привет"; Encoding ascii = Encoding.ASCII; Encoding unicode = Encoding.Unicode; byte[] unicodeBytes = unicode.GetBytes(unicodeString); byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes); char[] asciiChars = new char[ascii.GetCharCount(asciiBytes, 0, asciiBytes.Length)]; ascii.GetChars(asciiBytes, 0, asciiBytes.Length, asciiChars, 0); string asciiString = new string(asciiChars);
unicodeStringis determined by the encoding of the source file. Check it through the file properties in the VS project tree. - ߊߚߤߘ