On Mon, Jul 25, 2016 at 10:28 AM, Steven D'Aprano <st...@pearwood.info> wrote: > I know that Linux and Mac OS X both use UTF-8 for filenames, and so support > all > of Unicode. But Windows, I'm not sure. It might be localised to only use > Latin-1 > (Western European) or similar.
Windows filesystems (e.g. NTFS, ReFS, UDF, exFAT, FAT32) use Unicode [1], i.e. UTF-16, as does the Windows wide-character API. Using 16-bit wchar_t strings is a problem for C standard functions such as fopen, which require 8-bit null-terminated strings, so the Windows C runtime also supports wide-character alternatives such as _wfopen. Python's os and io functions use Windows wide-character APIs for unicode arguments, even in 2.x. Unfortunately some 2.x modules such as subprocess use only the 8-bit API (e.g. 2.x Popen calls CreateProcessA instead of CreateProcessW). [1]: https://msdn.microsoft.com/en-us/library/ee681827#limits _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor