convert cyrillic from console app to Unicode C#
-
Hi I have already wrote about my problem. I have a string that comes from console app after it i convert it with this procedure static private string EncodeMessageForConsoleOutput(string Message) { //gag if (MemoLog == null) return Message; if (EncodingFrom.CodePage == EncodingTo.CodePage) return Message; Decoder decoder = Encoding.UTF8.GetDecoder(); byte[] bytes = Encoding.UTF8.GetBytes(Message); char[] chars = new char[bytes.Length * 5];//*2 int bytesUsed, charsUsed; bool completed; decoder.Convert(bytes, 0, bytes.Length, chars, 0, chars.Length, true, out bytesUsed, out charsUsed, out completed); string ResultString = new string(chars, 0, charsUsed); return ResultString; } but it does not work Could you help me what's the problem with this code?