python - gnu-binutils-strings utf-8 而不是 utf-16 或 ascii

标签 python unix utf-8 utf-16 binutils

我注意到 gnu-binutils-strings 可以打印出文件中的 utf-16 内容 - 该程序是否可以打印出 utf-8 字符串?如果是这样,哪些论点是合适的?我在使用 subprocess 的 python 环境中工作,并希望使用 subprocess.Popen 调用将通过管道生成的 gnu-binutils-strings 的输出。

最佳答案

我对 strings 没有经验,但我的版本 (2.21.51.20110605) 有一个 8 位编码选项 (-eS),可以处理 utf-8 文本。它必须广撒网寻找由不可打印字符(值 < 32)分隔的“文本”。我预计会有很多噪音。对随机可执行文件的测试显示 -eS(8 位)结果比 -es(7 位)大 5 倍。

关于python - gnu-binutils-strings utf-8 而不是 utf-16 或 ascii,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7863986/

相关文章:

python - waitKey(0) 和 waitKey(1) 的输出差异

python - 英国广播公司微:bit - Radio string transfer random carriage returns

python - 如何在 python 中使用多重处理附加到类变量?

unix - Unix 中的用户无法运行 hadoop 命令

python - 在 python 脚本中使用 utf-8 文件名时出错

mysql - ISO_1 转 UTF8 失败

php - 字符集设置为 UTF-8,但 mysqli 报告不是 utf8

python - DateField 不将 date.today 作为默认值

c - 警告 : format ‘%d’ expects argument of type ‘int’ , 但参数 2 的类型为 ‘long int’ [-Wformat=]

linux - Logrotate 脚本未运行