About 1,250,000 results
Open links in new tab
  1. c# - How to write Unicode characters to the console ... - Stack Overflow

    Apr 23, 2016 · It's likely that your output encoding is set to ASCII. Try using this before sending output: Console.OutputEncoding = System.Text.Encoding.UTF8; (MSDN link to supporting documentation.) And here's a little console test app you may find handy: C#

  2. c# how to output Unicode characters? - Stack Overflow

    Nov 1, 2016 · The console is probably not using a Unicode or Japanese encoding, and/or the font used does not contain the required character glyphs. Have a look at Console.OutputEncoding for more information, and the Unicode Support for the Console section.

  3. Outputting a Unicode character in C# - Stack Overflow

    Feb 15, 2016 · string myString = "\u2649"; byte[] unicode = System.Text.Encoding.Unicode.GetBytes(myString); Console.WriteLine(unicode.Length); The result I'm getting is the number 2 instead of the symbol or …

  4. Problems with Unicode character encoding : r/csharp - Reddit

    Sep 18, 2022 · The default encoding of the terminal doesn't seem to be set to a Unicode codepage on your system. Try to set Console.OutputEncoding: Console.OutputEncoding = Encoding.UTF8; // or your variable 'utf8'

  5. Problems with Unicode character encoding : r/learncsharp - Reddit

    Sep 18, 2022 · I'm having difficulties with converting and displaying Unicode characters in one of my C# projects. So I decided to try one of the examples published by Microsoft : // Create a UTF-8 encoding. UTF8Encoding utf8 = new UTF8Encoding(); // A Unicode string with two characters outside an 8-bit code range. String unicodeString =

  6. UTF32 and Console App in C# - Microsoft Q&A

    Nov 20, 2022 · Of the Unicode encodings, the Console class supports UTF-8 encoding with the UTF8Encoding class and, starting with the .NET Framework 4.5, it supports UTF-16 encoding with the UnicodeEncoding class. UTF-32 encoding with the UTF32Encoding class is not supported. Attempting to set the output encoding to UTF-32 throws an IOException.

  7. Introduction to character encoding in .NET - .NET | Microsoft Learn

    Oct 22, 2024 · A well-formed Unicode encoding is a string of code units that can be decoded unambiguously and without error into a sequence of Unicode scalar values. Well-formed data can be transcoded freely back and forth between UTF-8, UTF-16, and UTF-32.

  8. Printing unicode to console in C# - C# Corner

    I can't get the Console to print unicode characters using the Console.WriteLine or Console.Out.WriteLine. After searching the Internet, I found two suggestions. Console.WriteLine ("Smiley face: ????"); Problem is that both these approaches give the same error below: Smiley face: ???? The handle is invalid.

  9. .net - C# Unicode string output - Stack Overflow

    I have a function to convert a string to a Unicode string: private string UnicodeString(string text) { return Encoding.UTF8.GetString(Encoding.ASCII.GetBytes(text)); } But when I am calling this function the output result is wrong. It looks like my function is not working.

  10. Console encoding defaults to UTF-8 · Issue #17849 - GitHub

    With .NET Core, the default encoding on my W10 box is now UTF-8. In the full .NET Framework, this was IBM437. Running the code fragment below gives the following results: .NET Core: Speed 24 116,00 KB/s Encoding: Unicode (UTF-8) | utf-8...

Refresh