Failed to open slide file name contains non-ascii character

Benjamin Gilbert bgilbert at
Tue Sep 8 19:14:54 EDT 2015

Hi Ray,

On 09/06/2015 10:59 PM, zhaoy at wrote:
> The mail list can’t be searched.

There's a search box at the top of the OpenSlide website.

> Recently we trying to use OpenSlide on Windows with the prebuilt
> binaries. It works well except failed to open a file name contains some
> non-ascii characters like Japanese of Chinese. I tried pass filename
> parameter with OEM/UTF8 encoding, but non of it works.

OpenSlide was opening files with fopen(), which on Windows expects the 
filename to be in the ANSI code page.  That won't work, of course, with 
arbitrary filenames.  I've modified OpenSlide to interpret filenames as 
UTF-8 on Windows and use _wfopen():

Try the 2015-09-08 build:

It turns out that the OpenSlide command-line tools were reading the ANSI 
command line instead of the Unicode command line, which was causing a 
similar problem in the tools.  They're still broken in the 2015-09-08 
build, but should be fixed in tomorrow's build.

Thanks for the report!

--Benjamin Gilbert

More information about the openslide-users mailing list