Inno Setup Unicode版本仍然无法正确显示西里尔文 [英] Inno Setup Unicode version still doesn't display Cyrillic properly

查看:114
本文介绍了Inno Setup Unicode版本仍然无法正确显示西里尔文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Inno Setup 5.5.2(u),并且所有符号都很好,除了TStringList中的动态填充字符串之外.我以这种方式初始化列表并添加项目:

I am using Inno Setup 5.5.2 (u) and all symbols are fine except the dynamically filled strings in TStringList. I initialize the list and add items this way:

Regions := TStringList.Create;
Regions.Add('Аврен');
Regions.Add('Айтос');
Regions.Add('Аксаково');
Regions.Add('Алфатар');
...

但是我得到了它们:

感谢您对此进行调查.

推荐答案

您目前不能在Inno Setup中使用Unicode常量.在 documentation 中,有一个报价(我强调):

You can't use Unicode constants in Inno Setup at this time. In documentation there's a quote about it (emphasized by me):

Unicode编译器使用的新RemObjects PascalScript版本 支持Unicode,但不支持其输入源.这意味着它确实使用 如上所述的Unicode字符串类型,但其中的所有文字Unicode字符 该脚本将转换为ANSI .

The new RemObjects PascalScript version used by the Unicode compiler supports Unicode, but not for its input source. This means it does use Unicode string types as said, but any literal Unicode characters in the script will be converted to ANSI.

这并不意味着您无法显示Unicode字符串:您可以 示例而是使用编码的Unicode字符来构建Unicode 字符串(例如S:=#$ 0100 +#$ 0101 +'Aa';),或从 使用LoadStringsFromFile文件,或使用{cm:...}常量.

This doesn't mean you can't display Unicode strings: you can for example instead use encoded Unicode characters to build Unicode strings (like S := #$0100 + #$0101 + 'Aa';), or load the string from a file using LoadStringsFromFile, or use a {cm:...} constant.

因此,从那里写的内容中,您可以采用以下格式对这些常量字符进行编码:

So from what is written there, you can either encode those constant chars in the following format:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Code]
procedure InitializeWizard;
var
  Regions: TStringList;
  ComboBox: TComboBox;
  CustomPage: TWizardPage;
begin
  CustomPage := CreateCustomPage(wpWelcome, 'Caption', 'Description');
  ComboBox := TComboBox.Create(WizardForm);
  ComboBox.Parent := CustomPage.Surface;

  Regions := TStringList.Create;
  try
    Regions.Add(#$0410 + #$0432 + #$0440 + #$0435 + #$043D
    Regions.Add(#$0410 + #$0439 + #$0442 + #$043E + #$0441
    Regions.Add(#$0410 + #$043A + #$0441 + #$0430 + #$043A + #$043E + #$0432 + #$043E
    Regions.Add(#$0410 + #$043B + #$0444 + #$0430 + #$0442 + #$0430 + #$0440
    ComboBox.Items.AddStrings(Regions);
  finally
    Regions.Free;
  end;
end;

或者您可以通过建议的 LoadStringsFromFile 加载区域列表a>来自外部文件的函数,并使用输出数组填充字符串列表(或直接填充组合框).

Or you can load a list of regions by the suggested LoadStringsFromFile function from an external file and with the output array fill the string list (or directly the combo box).

或者您可以制作一个外部 custom messages 文件.

Or you can make an external custom messages file.

这篇关于Inno Setup Unicode版本仍然无法正确显示西里尔文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆