1
1
12rbah2019-10-21 18:37:03
go
12rbah, 2019-10-21 18:37:03

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

2 answer(s)
X
xmoonlight, 2019-10-21
@xmoonlight

How to correctly guess the character encoding in a file?

F
falconandy, 2019-10-22
@falconandy

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 question

Ask a Question

731 491 924 answers to any question