Inno setup UTF-8字符在Inno设置中未正确显示
我已经看到了一些关于这方面的其他帖子,但我花了一段时间试图将其排序,但没有结果 以下是my.iss文件的通用版本:Inno setup UTF-8字符在Inno设置中未正确显示,inno-setup,Inno Setup,我已经看到了一些关于这方面的其他帖子,但我花了一段时间试图将其排序,但没有结果 以下是my.iss文件的通用版本: ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define AppName "MyApp" #define CompanyName "MyCompany" #define Fi
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "MyApp"
#define CompanyName "MyCompany"
#define FileName "File Name"
#define AppExeName "App Exe.exe"
#define AppIcon "..\icon.ico"
#define AppId "app.id"
#define AppURL "mywebsite"
#define AppSrcDir "path\to\app\directory"
#define AppTargetDir "{userappdata}\" + CompanyName + "\" + AppName
#define AppVersion GetFileVersion(AppSrcDir + "\" + AppExeName)
#define AppPublisher "Publisher"
#define LaunchMessage "Launch Message"
#define AppProtocol "protocol"
#define OutputDir "path\to\output"
#define SetupFilename FileName + "-setup-" + AppVersion
#define SetupImage "..\setup.bmp"
#define InstallerMessage "Some message with a German character - ö"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AllowCancelDuringInstall=no
AppId={#AppId}
AppName={#AppName}
AppVersion={#AppVersion}
AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={#AppTargetDir}
DefaultGroupName={#CompanyName}
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
DisableReadyMemo=yes
OutputDir={#OutputDir}
OutputBaseFilename={#SetupFilename}
PrivilegesRequired=lowest
SetupIconFile={#AppIcon}
SignTool=signtool
Compression=lzma/ultra64
SolidCompression=yes
WizardSmallImageFile={#SetupImage}
UninstallDisplayIcon={app}\{#AppExeName}
[InstallDelete]
Type: filesandordirs; Name: {#AppTargetDir}
[Languages]
Name: de; MessagesFile: "compiler:Languages\German.isl"
[Files]
Source: "{#AppSrcDir}\*"; DestDir: "{app}"; Flags: recursesubdirs
Source: "path\to\other\installers\win32\*"; DestDir: "{app}\redist";
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; WorkingDir: "{app}";
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; WorkingDir: "{app}";
[Run]
FileName: "{app}\redist\installer.exe"; Parameters: "/S /v/qn"; WorkingDir: "{app}"; StatusMsg: "{#InstallerMessage}";
我的问题是它不能正确显示InstallerMessage
文本。ö
字符无法正确渲染
我使用的是Unicode版本的Inno设置(带有“(u)”)
我见过一些关于使用字节顺序标记的提到,但我没有看到任何例子。我尝试使用UTF-8编码器转换整个字符串,并在开头添加了字节顺序标记,但没有成功。我完全被难住了 确保您的
.iss
文件对BOM使用UTF-8编码。当然,您需要Unicode版本的Inno Setup(Inno Setup 6的唯一版本)
在Pascal脚本代码中是否也使用了字符串(什么不是,只是为了其他人的利益,谁可能会发现这个问题),您还必须使用或更高版本。早期版本不支持Pascal脚本中的UTF-8 Pascal脚本更改:
Unicode Inno设置:输入源现在支持Unicode。例如,在您必须编写
S:=#$0100+#$0101+'Aa'之前的位置代码>您现在可以编写S:=“ĀāAa”代码>直接。另请参见新的UnicodeExample1.iss示例脚本
是的,这同样适用于iss可能导入的许可证文件。此文件的带BOM的UTF-8也需要正确呈现非ASCII字符。非常感谢@Reverate提供了如何使用VSCode快速转换的技巧。