解决方法
Utf8Encode函数将WideString字符串作为参数并返回Utf-8字符串.
样品:
procedure ConvertANSIFileToUTF8File(AInputFileName,AOutputFileName: TFileName); var Strings: TStrings; begin Strings := TStringList.Create; try Strings.LoadFromFile(AInputFileName); Strings.Text := UTF8Encode(Strings.Text); Strings.SaveToFile(AOutputFileName); finally Strings.Free; end; end;