UTF8
Posted: Fri Jun 18, 2021 3:31 pm
What is the simplest way to load a file with specific encoding? On most editor components I use I can do it this way:
What I did with the SRichView was this:
That works but is there some easier way I'm missing?
Also, is there a way to make opening and saving text files as UTF8 default?
Thanks!
Code: Select all
memo.Lines.LoadFromFile('test.txt',TEncoding.UTF8);
Code: Select all
ms := TStringStream.Create('', TEncoding.UTF8);
ms.LoadFromFile(FileName);
ms.Position := 0;
SRichViewEdit1.ActiveEditor.InsertText( ms.DataString );
ms.Free;
Also, is there a way to make opening and saving text files as UTF8 default?
Thanks!