You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename an image file to a name containing non-ASCII characters (e.g. абвгд.png, with Cyrillic letters).
Open the image in ImageGlass.
Right click and select "Image properties".
Instead of the image properties, an error message box pops up, saying that the file "?????.png" cannot be opened. I assume that the file name string is incorrectly converted to/from Unicode.
The text was updated successfully, but these errors were encountered:
It does. I think the answer may be that you're calling the ANSI version of ShellExecuteEx instead of the Unicode version. Try adding CharSet = CharSet.Unicode to the DllImport attribute.
I have images with Japanese characters in the filename. To get properties to work for these images, I found that two changes were required to ImageInfo.cs:
Declare the DllImport statement with CharSet.Auto:
[DllImport("shell32.dll", CharSet=CharSet.Auto)]
private static extern int ShellExecuteEx(ref SHELLEXECUTEINFO s);
The first four strings in the SHELLEXECUTEINFO structure need to be marshaled appropriately:
[MarshalAs(UnmanagedType.LPWStr)]
public string lpVerb;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpFile;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpParameters;
[MarshalAs(UnmanagedType.LPWStr)]
public string lpDirectory;
I tried just setting the lpFile member to LPWStr, but that seemed to be insufficient.
To reproduce this issue:
Instead of the image properties, an error message box pops up, saying that the file "?????.png" cannot be opened. I assume that the file name string is incorrectly converted to/from Unicode.
The text was updated successfully, but these errors were encountered: