Skip to content

Console.OutputEncoding by default returns a wrong value on Windows Nano Server #42959

Closed

Description

@ViktorHofer
Encoding curEncoding = Console.OutputEncoding;

On Windows Nano Server curEncoding.EncodingName is "Codepage - 0" which looks like a default value. This might be a product issue where the Encoding can't be retrieved when pinvoking.

cc @eiriktsarpalis

Activity

  1. added this to the 6.0.0 milestone on Oct 1, 2020
  2. added
    untriaged
    on Oct 1, 2020
  3. removed
    untriaged
    on Oct 1, 2020
  4. danmoseley commented on Oct 2, 2020

    @danmoseley
    Contributor

    This just means that ::GetConsoleOutputCP() failed. In such a case we still create and return an Encoding about a nonexistent codepage 0. (We did this in .NET Framework too so I am not sure whether it would be a good idea to change it to throw instead.)

    I am guessing this API is just stubbed out on Nano and perhaps we should just leave the code as is.

  5. modified the milestones: 6.0.0, 7.0.0 on Jul 26, 2021
  6. added
    backlog-cleanup-candidate
    on Jul 9, 2022
  7. modified the milestones: 7.0.0, Future on Jul 9, 2022
  8. ghost closed this as completedon Jul 23, 2022
  9. ghost locked as resolved and limited conversation to collaborators on Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Consolebacklog-cleanup-candidatebugno-recent-activityos-windows-nano

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions