Was it really possible to open files (standalone identify and convert) with unicode filename under windows?
No; not by using 'convert' or 'identify', anyway. If you wrote your own program that calls OpenMagickStream() directly, then you could have done it by encoding the filename in UTF-8.
The patch does improve the behavior of 'convert', etc. But I don't know whether it breaks anything else. And it's sort of a step away from the full solution.
It occurred to me that the patch, by converting from "ANSI" to UTF-16 and then calling _wfopen, is probably doing exactly what fopen does. You could probably compile IM with MAGICKCORE_HAVE__WFOPEN undefined, and get the same result.
Somebody went to the trouble of writing the code in the "#if defined(MAGICKCORE_HAVE__WFOPEN)" sections, but then apparently didn't make the necessary changes elsewhere to make it useful. Strange.
UTF-8 probably should only be used only to convert label/meta-data commands
Admittedly, it would be hard to make everything work perfectly (what if a filename needs to be printed to the terminal?). But if you have to support Unicode filenames, storing them internally as UTF-8 make sense in this application, simply because all the other options are worse.
magick wrote:Consider coding up a wmain() that converts the argv to UTF8 which we can then pass to ImageMagick.
Although it was one of the things I suggested, I have growing concerns that this could open up a can of worms, and cause any number of subtle compatibility problems. I don't really know what to recommend. I may try it, but don't expect something that can be immediately released.