问题描述
使用 python 调用 antiword 将 doc 转换成 txt,发现返回值是乱码,powershell 上用 antiword 也是乱码,在 git bash 上调用就没问题
环境背景及自己尝试过哪些方法
环境:windows 平台,py3.6 尝试过改 locale,还试过 antiword 的-m 参数,但是没什么用
相关代码
pipe = subprocess.Popen(
['antiword', filename],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE )
stdout, stderr = pipe.communicate()
return stdout