2013.03.21 10:49 "[Tiff] TiffOpenW() not opening tiff file containing Japanese character", by Sunanda Chowdhary

2013.03.21 13:39 "Re: [Tiff] TiffOpenW() not opening tiff file containing Japanese character", by Bob Friesenhahn

Which platform are you on? If you're on Windows with Visual Studio, I've personally had problems with it recognizing UTF-8 string literals like in the code you posted. I'd double-check what wname is actually what you think it is. On Windows, you can confirm whether the file can be opened by calling _wopen(wname, ...) and checking if you have a valid file.

The other idea is to ensure you have an error handler installed prior to calling TIFFOpenW() and checking to see what is the error generated by TIFFOpenW().

From what I have read, the definition of a wide character is platform-dependent. I remember that Windows uses UTF-16 and OS X uses UTF-32.

Ultimately, the value needs to match the value used by the filesystem. any small encoding difference would cause a failure to match. A filename which "looks" the same might not be the same.

Some filesystems support multiple filename encodings and the filesystem remembers the encoding which was used.

The safest thing to do is to obtain the filename via an operating system API and pass that to libtiff.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/