bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/30382] New: Add LD option for using UTF-8 code page in generated


From: pali at kernel dot org
Subject: [Bug ld/30382] New: Add LD option for using UTF-8 code page in generated Windows PE binaries
Date: Sun, 23 Apr 2023 07:58:12 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=30382

            Bug ID: 30382
           Summary: Add LD option for using UTF-8 code page in generated
                    Windows PE binaries
           Product: binutils
           Version: 2.39
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: pali at kernel dot org
  Target Milestone: ---

Windows PE binaries generated by LD use by default legacy code page (e.g.
CP1252) when working with any char* WinAPI function, including argv[] arguments
in main.

Legacy code pages do not support whole range of UNICODE characters and
therefore passing non-ASCII filename via argv[] to main() loose processing of
command line arguments.

UTF-8 is now widely used, so LD should support generating Windows PE binaries
in a way that are marked as UTF-8 compatible. Windows OS then will use UTF-8 as
code page for all char* WinAPI function and will pass argv[] to main() in UTF-8
too.

Switching code page to specific one for Windows PE binary is done by adding
activeCodePage element into manifest.

So please add some LD switch --active-code-page= for specifying code page which
will be put into the final generated Windows PE binary.

It should be considered for future that LD sets this --active-code-page=
automatically to UTF-8 by default for all Windows PE binaries as usage of
legacy code pages in application runtime is nowadays in UTF-8 ere just legacy.

Please note that LD currently does not support manifests at all:
https://sourceware.org/bugzilla/show_bug.cgi?id=30381

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]