how to read file with BOM? lazarus / 31-LCL ---------------------------------------------------------------------- svd71 · 2016-12-22 18:28 Hello everybody. I wanna  trying to understanding, how need to read the text file with any type of BOM and automatically convert it to UTF8 or Wide chars.  I am used in Delphi the TStreamReader  like this snippet and can read any char :   FS := TFileStream.Create(FileName, fmOpenRead + fmShareDenyNone);   try     FSR := TStreamReader.Create(FS, TMBCSEncoding.Create(CP_UTF8, 0, 0));     try       FS.Seek(0, 0);       while not FSR.EndOfStream do         parseBuff;     finally       FSR.Close;       FSR.Free;     end;   finally     FS.Free;   end; ... but in te Lazarus the TStreamReader haven't the constructor with input parameter as instance of TEncoder. Thank you for any answer.