{ Read the second byte }
if Encoding <> ekAnsi then
begin
BytesRead := FileRead(FileHandle, HighByte, SizeOf(Byte));
if HighByte = 0 then
wc := WideChar(LowByte)
else
wc := GetValue(HighByte, LowByte);
end
Perhaps a more correct way is if (Encoding = ekUnicode) and (HighByte = 0), or to alter the function GetValue in some way?
- Bergsoft Forum
- → Viewing Profile: Posts: Mountain
Community Stats
- Group Members
- Active Posts 12
- Profile Views 15,348
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Posts I've Made
In Topic: LoadFromCSV not working
08 March 2026 - 02:31 PM
In Topic: LoadFromCSV not working
17 December 2025 - 12:10 PM
Hi,
I understand. It is not easy.
So SaveToFile will be altered to save files as UTF8, instead of UTF16? Sounds good, preferably non BOM.
I'm looking forward to the update. ![]()
In Topic: LoadFromCSV not working
07 December 2025 - 02:01 PM
I noticed that the CSV file is saved as UTF16 with BOM.
If I resave the CSV file as ANSI or UTF8 without BOM, then the import works.
So, if you don't need unicode then you can add NxTypes6 to the unit, under uses, and set
grGroup.Serialize.Encoding := ekAnsi; //replace grGroup with the name of your TNxGrid6 component
And, in that case, any previously saved CSV needs to be converted to ANSI.
Seems like a problem with the support for UTF16 in LoadFromFile?
In Topic: LoadFromCSV not working
12 June 2025 - 11:49 PM
I came here to report the error "List index out of bounds (-1). TInterfaceList is empty." when using LoadFromCSV, and noticed there is already a topic for it. Maybe it only occurs in Delphi 12?
I'm attaching a demo project.
There is a "Test.csv" that I've created using the demo, but I can't load it back.
Demo features:
Press Insert to add rows to the grid.
Click Save to save grid content as "Test.csv" in exe-folder.
Click Open to load "Test.csv" from exe-folder.
- Bergsoft Forum
- → Viewing Profile: Posts: Mountain
- Privacy Policy



Find content