bfd: handle codepage when opening files on MinGW
authorClément Chigot <chigot@adacore.com>
Tue, 28 Jun 2022 07:42:12 +0000 (09:42 +0200)
committerClément Chigot <chigot@adacore.com>
Tue, 28 Jun 2022 14:55:24 +0000 (16:55 +0200)
commit68e80d96a84282d547f3b3c1234c99009521630c
tree2ed72fc7ad30f012a2c35e5a4b99410c53b8abb2
parentfadaf8f7f99f8fe81aa8403c5d90c95cae5bd2ec
bfd: handle codepage when opening files on MinGW

Even if MS docs say that CP_UTF8 should always be used on newer
applications, forcing it might produce undefined filename if the
encoding isn't UTF-8.
MinGW seems to call ___lc_codepage_func() in order to retrieve the
current thread codepage.

bfd/ChangeLog:

        * bfdio.c (_bfd_real_fopen): Retrieve codepage with
        ___lc_codepage_func() on MinGW.
bfd/bfdio.c