Word wrapping with "Use Unicode UTF-8 for worldwide language support"

56 views
Skip to first unread message

mpri...@gmail.com

unread,
Jun 22, 2023, 1:04:05 AM6/22/23
to innosetup
Word wrapping in Inno Setup seems to have problems with new Windows "Use Unicode UTF-8 for worldwide language support" option.
It might also be Windows bug though... :)
I can reproduce it on Windows 10 too. In 150% scaling (not in 100%).

Jordan Russell

unread,
Jun 20, 2024, 12:40:06 AMJun 20
to inno...@googlegroups.com
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

mpri...@gmail.com

unread,
Jun 20, 2024, 5:18:28 AMJun 20
to innosetup
Thanks for your response :)
Reply all
Reply to author
Forward
0 new messages