6

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.

Community
  • 1
  • 1
Fabio Vitale
  • 2,257
  • 5
  • 28
  • 38
  • 2
    I think you may want to read [how-can-i-detect-the-encoding-codepage-of-a-text-file](http://stackoverflow.com/questions/90838/how-can-i-detect-the-encoding-codepage-of-a-text-file). If the text file has a `BOM`, read it, otherwise it is not generally possible. – LU RD Feb 27 '12 at 09:24

1 Answers1

3

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.

Community
  • 1
  • 1
LU RD
  • 34,438
  • 5
  • 88
  • 296