madsen / vbindiff

Visual Binary Diff (VBinDiff) displays files in hex & ASCII and can highlight the differences between 2 files
479 stars 52 forks source link

Cannot open files with unicode filenames (Windows) #20

Open endolith opened 3 years ago

endolith commented 3 years ago

It returns an error message with them replaced by question marks:

λ "VBinDiff.exe" "CU-25 IC test.xls" "CU-25 IC  测试.xls"
VBinDiff 3.0_beta5, Copyright 1995-2017 Christopher J. Madsen
VBinDiff comes with ABSOLUTELY NO WARRANTY; for details type `vbindiff -L'.

Unable to open CU-25 IC ??.xls: The filename, directory name, or volume label syntax is
incorrect.
madsen commented 3 years ago

Yes, this is a consequence of using the Windows ANSI API instead of the wide-character version. I don't really do much Windows programming, and I've never done any I18N work on Windows. I'm not sure how much work it would be to convert VBinDiff to the W API. I'd be interested in a patch if somebody wants to try.

The workaround is to rename the file so it can be represented in the selected codepage.

rofl0r commented 3 years ago

interesting that this issue gets a reply, but series crash bugs don't.

namazso commented 2 years ago

you can simply compile the program with a manifest to use utf-8: https://docs.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page this is only for Windows 10 1903+ but is basically an effortless change