I need to be able to store certain Unicode characters in a few of my registry keys, but am unable to find the syntax to do this in an .iss file. I am using the Unicode version of Inno Setup
The Inno Setup site says this about Unicode values:
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 usingLoadStringsFromFile
, or use a{cm:...}
constant.
For example one of the one's I want to enter is the degrees Fahrenheit symbol (℉
) which is #$2109
.
I can't put #$2109
directly into the value string because that just prints out that text.
I tried to create a #define
constant but it doesn't recognize the #
and $
characters.
So I want:
[Registry]
Root: HKLM; Subkey: "MyPath"; ValueType string; ValueName: "MyName; \
ValueData: "Temperature [℉]"
but obviously I cannot put it in directly.
How do I get Unicode characters into the registry section, either directly or via some variable/constant, I'm fairly new to Inno Setup.
Thanks in advance!
Just make sure your .iss
file is UTF-8 encoded with BOM.
Then you can use UTF-8 strings directly in it (with Unicode version of Inno Setup), as the documentation says:
Unicode Inno Setup supports UTF-8 encoded .iss files (but not UTF-16).
[Registry]
Root: HKLM; Subkey: "MyPath"; ValueType: string; ValueName: "MyName"; \
ValueData: "Temperature [℉]"
(note that the entry syntax in your question is wrong, you are missing a colon and a quote)
An easy way to save the file in UTF-8 with BOM:
.iss
file in Inno Setup Compiler GUI.You need to do this before inserting your UTF-8 string. Also note that the Inno Setup Compiler editor cannot display the ℉
, but it will still work ok, when compiled.
Another way is:
.iss
file in Windows Notepad.Windows Notepad can display the ℉
(with an appropriate font, like the default Consolas or Lucida Console).