[fpc-pascal] TIniFile.WriteString gives file with BOM, bad

AlexeyT aaa5500 at ya.ru
Fri Jan 10 17:50:18 CET 2020


         ini_lexmap:= TIniFile.Create(fn_lexmap_final);
         try
           ini_lexmap.WriteString('ref', IntToStr(i_sub), s_lexer);
         finally
           FreeAndNil(ini_lexmap);
         end;

with FPC trunk it converts .ini file to UTF8 BOM! Bad, because then my 
code reads this .ini file and it cannot find its 1st section: 
BOMCHARS[ref] is not found, only [ref] is found in original file. So

1) don't write BOM via WriteString

2) if BOM is there, allow ReadString to find section at the file begin: 
BOMCHARS[ref]

fpc 3.3 r43852 linux x64.

-- 
Regards,
Alexey



More information about the fpc-pascal mailing list