Povilas
asked on
How to load/save text file to/from MEMO component in UTF-8 format?
I need to load simple text file to memo1 component and it is done easily by .Lines.LoadFromFile. Same with text save to file from memo1- .Lines.SaveToFile
How can I add UTF-8 text format support for this operation? (now it depends on system configuration)
by the way, I need to do some line string operations in that memo1 component (so I need to do string operations in UTF-8 also)
How can I add UTF-8 text format support for this operation? (now it depends on system configuration)
by the way, I need to do some line string operations in that memo1 component (so I need to do string operations in UTF-8 also)
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
S := UTF8Encode(Memo.Text);
AssignFile(F, );
try
Rewrite(F);
Write(F,#$EF+#$BB+#$BF); //UTF8
Write(F, S);
CloseFile(F);
except
end;