UTF32 and Console App in C#

Shervan360 1,681 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

Developer technologies | C#
Developer technologies | 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.
{count} votes

Answer accepted by question author
  1. Castorix31 91,496 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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.