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

Luca Olivetti luca at ventoso.org
Sat Jan 11 10:46:09 CET 2020

El 11/1/20 a les 0:19, Michael Van Canneyt ha escrit:
> On Fri, 10 Jan 2020, AlexeyT via fpc-pascal wrote:
>>         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
> I will disable the writing of BOM in TIniFile alltogether.

With backward compatibility please (i.e. that after the writing has been 
disabled TIniFile can still correctly read ini files that already have 
the BOM).



More information about the fpc-pascal mailing list