Skip to content

System.IO and System.Directory functions not Unicode-aware under Windows

Under Windows, System.Directory.getDirectoryContents seems to apply encoding conversions on filenames at the syscall level.

I have several files with Japanese names, but my default program locale is English. Unicode-aware applications (that is, most modern Windows programs) have no problems with this. Calling getDirectoryContents on a folder with Japanese names, however, returns strings consisted of question marks "???".

If I switch the default program locale to, say, Japanese, then the files are returned in ShiftJIS, but I lose information such as accented Latin characters.

Trac metadata
Trac field Value
Version 6.10.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/directory
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown/Multiple
Architecture
Edited by YitzGale
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information