Can't read FileVersionInfo with Code Page mismatch
问题 I have some reasonably tried and tested code which uses the Windows API calls to read FileVersionInfo strings, like "FileVersion" and "CompanyName". I found it failed with one particular 3rd party DLL. The problem seems to be this: Reading the \VarFileInfo\Translation value, I get 040904B0 (US English, Unicode). But when I then attempt to call VerQueryValue on \StringFileInfo\040904B0\CompanyName , it returns false. But tweaking the code to use the Windows Latin-1 ANSI codepage works: