Topic: [solved] LoadFromFile : Load a UTF8 file content as a string
Hi,
1°) The two following commands download a file. The content isn't the same (characters encoding problem?)
HTTPGetFile('http://radiofrance-podcast.net/podcast09/rss_10175.xml','rss.xml',false);
WriteLnToFile('rss.xml',HTTPGet('http://radiofrance-podcast.net/podcast09/rss_10175.xml'));
2°) When I try to load the content of the file with :
sl:=TStringList.Create;
sl.LoadFromFile('rss.xml');
The content (UTF-8) isn't properly decoded. Sample:
'D├®bat de quarante minutes abordant les grandes questions actuelles'
instead of
'Débat de quarante minutes abordant les grandes questions actuelles'
How can I solve this problem? Is there a way to specify the encoding of the loaded file (ie. sl.LoadFromFile('rss.xml','utf-8') ?
Kind regards,
jihem
https://jihem.itch.io