okio icon indicating copy to clipboard operation
okio copied to clipboard

Kotlin/Native on Windows with special characters in Path

Open gregorko opened this issue 3 years ago • 1 comments

I try to list the contents of a directory that contains files with special characters (German Umlaute like: ö, ä, ü, ß). The Path objects of the files are returned, but when using them I get a FileNotFoundException. Uncaught Kotlin exception: okio.FileNotFoundException: no such file: c:\temp\test�.txt

When calling exists() it always returns false.

I run the following code:

    FileSystem.SYSTEM.list("c:\\temp".toPath()).forEach {
        if (!FileSystem.SYSTEM.exists(it)) {
            println("Not found $it")
        }
    }

How can I enable special character support?

I use Kotlin 1.5.31 with okio 3.0.0. Tried to run this on Windows 10 and Windows Server 2012

gregorko avatar Jan 15 '22 21:01 gregorko

I've added tests and all passed, including Windows in #1086. Would you be able to write a failing test on Okio?

oldergod avatar Jan 17 '22 16:01 oldergod