check Encoding.default_external, not IO#external_encoding
fix warning