def get_utf_8_version(file_name, origin_encoding): fp, tmp_name = tempfile.mkstemp(text=True) get_command_output_first_line([ "iconv", "--from-code", origin_encoding, "--to-code", "UTF-8", "-o", tmp_name, file_name ]) return tmp_name
def get_command_output_first_line(commands, in_shell=False): print "Please import deepin_utils.process.get_command_output_first_line, this function will departed in next release version." return process.get_command_output_first_line(commands, in_shell=False)
def get_utf_8_version(file_name, origin_encoding): fp, tmp_name = tempfile.mkstemp(text=True) get_command_output_first_line(["iconv", "--from-code", origin_encoding, "--to-code", "UTF-8", "-o", tmp_name, file_name]) return tmp_name