[Lazarus] Guessing the encoding of some text

Torsten Bonde Christiansen tc at epidata.info
Thu Nov 16 11:25:07 CET 2017

Hi List.

I am reading some text of some .csv files, but the encoding of the files 
is not always the same. In fact it may vary greatly from a lot of 
european encodings, UTF8 and asian encoding.

I have tried using the function GuessEncoding(..) in LConvEncoding.pas, 
but from the source code I can see that it mostly focuses on BOM's and 

Does Lazarus or FPC include other convinient tools that may detect the 
encoding of (the content of) a file?
What do others do in this situation?

My goal is to convert all the read text to UTF-8.

Kind regards,

More information about the Lazarus mailing list