我有一个Inno脚本,该脚本从文件夹中读取文本文件“ Version.txt”,并以无线电格式显示内容,如下图所示。问题不是显示:“ Version 1.0”&“ Version 2.0”。它显示了诸如“ yBC”和“ yBC”之类的文本,令人难以理解。如何纠正代码以从文本文件读取unicode格式?
if ((FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY) <> 0) and
(FindRec.Name <> '.') and
(FindRec.Name <> '..') then
begin
Path := RootPath + '\' + FindRec.Name;
{ LoadStringFromFile can handle only ascii/ansi files, no Unicode }
if LoadStringFromFile(Path + '\' + 'Version.txt', Name) then
begin
Dirs.Add(Path);
DirCheckListBox.AddRadioButton(Name, '', 0, False, True, nil);
{ If already installed, check the path that was selected previously, }
{ otherwise check the first one }
if (DirCheckListBox.Items.Count = 1) or
(CompareText(WizardForm.DirEdit.Text, Path) = 0) then
begin
DirCheckListBox.ItemIndex := DirCheckListBox.Items.Count - 1;
DirCheckListBox.Checked[DirCheckListBox.ItemIndex] := True;
end;
end;
end;