Command Line Encoding File Format: Windows

I have a file that can be in ASCII or UTF-8 format. I can find out what format it represents using Notepad ++. But can anyone call me with a tool that could show me what format the file is on the command line.

Example: Open a command prompt,

C:><Some Command> FileName

which should provide me with a file format such as ASCII or UTF-8.

+5
source share
2 answers

This is a duplicate of this question here , which has an excellent answer (not I could add)

EDIT

, , , , , (BOM) , , , .

- -, , , .

-3
  • Python 3.x
  • cmd.exe(Administrator): pip install chardet
  • python script, , chardet. . .
  • script - PATH

, ec.py . ec FileName , . python script, - ec *.txt .

-1

All Articles