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.
On Windows
sigtool --infodoesn't work with unicode characters in its file path.How to reproduce:
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
fopenassumes the encoding of the input file path is ACP, which in my case is ISO 8859-1. There are different solutions to this:_wfopenoverfopensetlocalebeforefopenmay workAlthough 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.