support encoding when default_encoding is not defined