implemented EncodingForConsole that determines an appropriate encoding for console stream