UTF32 and Console App in C#

Shervan360 1,481 Reputation points
2022-11-20T23:15:57.02+00:00

Hello,

Why can't I set UTF32? I have an exception error.

262304-screenshot-2022-11-20-151134.png

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,234 questions
{count} votes

Accepted answer
  1. Castorix31 81,636 Reputation points
    2022-11-21T03:32:12.233+00:00

    There is in the doc at Console.OutputEncoding :

    Notes to Callers
    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful