dotnet / dotnet/msbuild

Build tools' output encoding broken building a C++ project

Open
#12,290 4 comments 0 reactions 1 assignee Assigned to @AlesProkop View on GitHub
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Issue Description

For example:
- through MSBuild, link.exe output seems to be UTF-8 => OEM-850 encoded, non-ANSI characters are broken
- calling link.exe directly gives a well-encoded output

### Steps to Reproduce

- Language: French
- chcp of the MSVC developer terminal: any (850 default, 65001 to try, same result)

- Create a C++ project (called testVS here) with cpp with a simple main
- Open the MSVC developer console and "cd" to the folder where the .vcxproj is
- call `msbuild -v:m testVS.vcxproj /t:Rebuild`

### Expected Behavior

If you execute the link.exe command (call msbuild with -v:d to get it) :
> testVS.obj : warning LNK4075: ' /EDITANDCONTINUE' ignor**é** à cause de la sp**é**cification '/SAFESEH'

Image

Expected behavior with MSBuild: the same output, which is well-encoded

### Actual Behavior

> Version MSBuild 17.14.18+a338add32 pour .NET Framework
>
> **cl** : Ligne de commande warning D9035: l'option 'Gm' est d**é**conseill**é**e et sera supprim**é**e dans une version ult**é**rieure [...\testVS.vcxproj]
> testVS.cpp
> testVS.obj : warning LNK4075: ' /EDITANDCONTINUE' ignor**Ú Ó** cause de la sp**Ú**cification '/SAFESEH' [...\testVS.vcxproj]
> testVS.vcxproj -> ...\Debug\testVS.exe

Image

As you can see, cl.exe's output is good, but link.exe's one is broken.

### Analysis

_No response_

### Versions & Configurations

Version MSBuild 17.14.18+a338add32 pour .NET Framework
17.14.18.37206

Note : Bug detected in a CMake project, in the Visual Studio 2022 output window. In some scenario to define (msbuild calling msbuild calling link.exe?), there is a double encoding UTF-8 => OEM-850 (é is displayed├Ü: é => Ú => ├Ü)

Image

Edit : Well, cl.exe can have its special characters broken too, in error logs.
Image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.