Is there any command for command prompt through which I can know the default encoding of my system?

migrated from stackoverflow.com Feb 26 '10 at 11:51

This question came from our site for professional and enthusiast programmers.

  • 4
    Does the command "chcp" work? That will show the code page currently set for CMD. – music2myear Apr 2 '13 at 19:45

Just head to the 'Control Panel' → 'Regional and Language Options' → 'Advanced' tab.


Microsoft Docs has a solution to get the encoding for the operating system's current ANSI code page. You can use the following VB code:

'Declaration (FYI)
'Public Shared ReadOnly Property Default As Encoding

Dim value As System.Text.Encoding
value = System.Text.Encoding.Default
System.Console.WriteLine(value.WebName) ' (e.g.)

There are also syntaxes for C#, C++ and JScript. Have a look at Microsoft Docs for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy