gnu-binutils-strings utf-8 instead of utf-16 or ascii

与世无争的帅哥 提交于 2019-12-23 22:48:00

问题


I've noticed gnu-binutils-strings can printout utf-16 content in a file - is it possible for the program to print out utf-8 strings? if so, which arguments are appropriate? i'm working in a python environment using subprocess and would like to work with the output from gnu-binutils-strings that a subprocess.Popen call would generate through a pipe.


回答1:


I'm not experienced with strings, but the version I have (2.21.51.20110605) has an 8-bit encoding option (-eS) that would work with utf-8 text. It must have to cast a wide net looking for 'text' delimited by non-printable characters (value < 32). I'd expect a lot of noise. A test on a random executable showed the -eS (8-bit) result was 5 times bigger than -es (7-bit).



来源:https://stackoverflow.com/questions/7863986/gnu-binutils-strings-utf-8-instead-of-utf-16-or-ascii

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!