diff --git a/components/lazutils/lazutf8classes.pas b/components/lazutils/lazutf8classes.pas index 3f269e0dc4..02bae9c3fb 100644 --- a/components/lazutils/lazutf8classes.pas +++ b/components/lazutils/lazutf8classes.pas @@ -26,8 +26,37 @@ type procedure SaveToFile(const FileName: string); override; end; +procedure LoadStringsFromFileUTF8(List: TStrings; const FileName: string); +procedure SaveStringsToFileUTF8(List: TStrings; const FileName: string); + implementation +procedure LoadStringsFromFileUTF8(List: TStrings; const FileName: string); +var + uList: TStringListUTF8; +begin + uList:=TStringListUTF8.Create; + try + uList.LoadFromFile(FileName); + List.Assign(uList); + finally + uList.Free; + end; +end; + +procedure SaveStringsToFileUTF8(List: TStrings; const FileName: string); +var + uList: TStringListUTF8; +begin + uList:=TStringListUTF8.Create; + try + uList.Assign(List); + uList.SaveToFile(FileName); + finally + uList.Free; + end; +end; + constructor TFileStreamUTF8.Create(const AFileName: utf8string; Mode: Word); var lHandle: THandle;