Skip to content

ildasm has problems with non-ASCII characters #64045

@nnn1590

Description

@nnn1590

Description

ildasm gives incorrect results if the input or output filename contains non-ASCII characters.

Reproduction Steps

cd "$(mktemp -d)"
dotnet new console --name bug --output .
dotnet add package runtime.linux-x64.Microsoft.NETCore.ILDAsm --version 6.0.0
dotnet build  # -> bin/Debug/net6.0/bug.dll

~/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/6.0.0/runtimes/linux-x64/native/ildasm -output=123123.il bin/Debug/net6.0/bug.dll
~/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/6.0.0/runtimes/linux-x64/native/ildasm bin/Debug/net6.0/bug.dll -output=ASCII_and_NON−ASCII_CHARACTERS.il
~/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/6.0.0/runtimes/linux-x64/native/ildasm -output=ASCII_and_NON−ASCII_CHARACTERS.il bin/Debug/net6.0/bug.dll

Expected behavior

File names are processed correctly.

Actual behavior

$ ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/6.0.0/runtimes/linux-x64/native/ildasm -output=123123.il bin/Debug/net6.0/bug.dll
error : File 'bin/Debug/net6.0/bu' not found or not a PE file
$ ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/6.0.0/runtimes/linux-x64/native/ildasm bin/Debug/net6.0/bug.dll -output=ASCII_and_NON−ASCII_CHARACTERS.il
("ASCII_and_NON−ASCI" generated instead of "ASCII_and_NON−ASCII_CHARACTERS.il")
$ ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/6.0.0/runtimes/linux-x64/native/ildasm -output=ASCII_and_NON−ASCII_CHARACTERS.il bin/Debug/net6.0/bug.dll
(The usage shown)

Regression?

No response

Known Workarounds

Don't use non-ASCII characters in the path.

Configuration

  • Which version of .NET is the code running on?
    .NET 6.0.101 (dotnet-sdk-6.0/focal,now 6.0.101-1 amd64 installed)
  • What OS and version, and what distro if applicable?
    Ubuntu 20.04 LTS amd64
  • What is the architecture (x64, x86, ARM, ARM64)?
    x64
  • Do you know whether it is specific to that configuration?
    I don't know.

Other information

I'm sorry if my english is wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions