Load file in UTF


I try to import data into a tADVColumnGrid using this method :

This file is a text file delimited by pipe "|" and it is encoded in UTF8.

The result of this importation is :
|Castelló d'Empúries||

whereas it sould be :
|Castelló d'Empúries||

How to get the right information ?


No idea ? :(

SWAG, did you set the: AdvStringGrid1.Delimiter:='|';

yes, of course

Does the file have a byte order mark (BOM)?  If not, there is a LoadFromCSV overload which has an encoding parameter you can set, provided you have a Delphi version which supports Unicode.  


You are right the BOM didn't exists, I added it and now it works ;)



When i LoadFromCsv a file with a BOM (FF FE) in a TadvStringGrid the result is not correct 
I use Delphi 10.3 release 2
TadvStringGrid (August 2019)
Do i have to define somewhere that i want to use unicode ?


There is a parameter TEncoding in an overload of the grid.LoadFromCSV() method.
Specify the right encoding type with this TEncoding parameter.


I saw that overloaded method but 
i didn't reach it because enclosed between {#IFDEF DELPHI_UNICODE}  in advgrid.pas
Where do i have to define that ?

    procedure LoadFromCSV(FileName: String; MaxRows: integer = -1; IgnoreRows: integer = -1); overload;
    procedure LoadFromCSV(FileName: String; AEncoding: TEncoding; MaxRows: integer = -1; IgnoreRows: integer = -1); overload;

Sorry, stupid question

It works Fine