Answer the question
In order to leave comments, you need to log in
How to determine the encoding of a text file?
It is necessary to check the presence of a word in the text, but in the same folder there may be texts in both ANSI and UTF-8. Is it possible to determine the file encoding, or will I have to check first for one encoding then for another?
Answer the question
In order to leave comments, you need to log in
Haven't used it, but like https://github.com/saintfish/chardet should work. True, it has not been updated for a very long time, but it can probably be taken as a basis.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question