Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect the character encoding of a text file using Delphi? [duplicate]

Possible Duplicate:
How can I detect the encoding/codepage of a text file
How Can I Best Guess the Encoding when the BOM (Byte Order Mark) is Missing?

I would like to know if there are some delphi libraries for the purpose of detecting the character encoding of a text file.

like image 432
Fabio Vitale Avatar asked Feb 27 '12 08:02

Fabio Vitale


1 Answers

In my comment there was a link to how-can-i-best-guess-the-encoding-when-the-bom-byte-order-mark-is-missing which may work for you if the text files have no BOM.

Look at the Charset Detector library and try it out. It will try to read the BOM and if it's not there make a best effort guess.

like image 164
LU RD Avatar answered Oct 03 '22 16:10

LU RD