modified GetEncodingForConsole