Skip to content

Missing file when passing a file with unicode characters in its path on windows to sigtool --info #1515

Description

@ember91

On Windows sigtool --info doesn't work with unicode characters in its file path.

How to reproduce:

New-Item -ItemType File -Path file_öταБЬℓσ.txt
sigtool --info file_öταБЬℓσ.txt

Which leads to "Can't open file file_öταБЬℓσ.txt". Although if I remove the unicode characters from the file name and try again I get the error "Can't read CVD header in file_.txt" which may be expected since the file is empty.

This is since fopen assumes the encoding of the input file path is ACP, which in my case is ISO 8859-1. There are different solutions to this:

  • Use _wfopen over fopen
  • Using setlocale before fopen may work
  • Adding a manifest which sets the UTF-8 parameter

Although best is probably to use the same solution as e.g. clamscan and others use since they seem to work with unicoded file paths already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions