Make options.parse_config_file supporting custom encoding

In python 3, when the encoding of a config file is different from locale.getpreferredencoding(False), options.parse_config_file may fail.