On 6/22/23 12:04 AM,
mpri...@gmail.com wrote:
> Word wrapping in Inno Setup seems to have problems with new Windows "Use
> Unicode UTF-8 for worldwide language support" option.
> Seehttps://
stackoverflow.com/q/76525224/850848
> It might also be Windows bug though... 🙂
> I can reproduce it on Windows 10 too. In 150% scaling (not in 100%).
(Old thread but not forgotten!)
The text is displayed using a subclass of the standard Windows STATIC
control (TNewStaticText). The subclass does not do any word breaking or
painting itself -- STATIC's WM_PAINT handler does all that -- so I don't
think this could be an Inno Setup issue.
And I would strongly advise against ever enabling that option. ANSI apps
are generally programmed with the assumption that characters can only be
1 or 2 bytes in length (and use IsDBCSLeadByte or similar to identify
2-byte characters), so you may run into string truncation issues (i.e.,
data corruption issues) when UTF-16 to CP_ACP conversion expands 1 wide
character into 3 bytes. Also, ANSI apps will generally see every UTF-8
byte as a separate character, so for example in a text editor it will be
possible to position the cursor in the middle of UTF-8 sequences. Typing
will then break apart the UTF-8 sequence, corrupting the text.
Old non-Unicode versions of Inno Setup are potentially impacted by these
issues. On Delphi 2.0 through 2007, wide-to-ANSI string conversion did
assume a maximum 2 byte character length when calculating the needed
buffer size.
-JR