How to identify the file content as ASCII or binary

后端 未结 10 2578
旧巷少年郎
旧巷少年郎 2020-11-28 05:54

How do you identify the file content as being in ASCII or binary using C++?

10条回答
  •  野性不改
    2020-11-28 06:21

    This question really has no right or wrong answer to it, just complex solutions that will not work for all possible text files.

    Here is a link the a The Old New Thing Article on how notepad detects the type of ascii file. It's not perfect, but it's interesting to see how Microsoft handle it.

提交回复
热议问题