Filename encoding

I noticed that the FMOD 5 documentation of System::createSound explicitly says that the filename has to be encoded using UTF-8. Does this mean that on Windows it will now convert the name from UTF-8 to UTF-16 and use CreateFileW to open the file?

I did a quick test on Linux by setting LANG to a locale with non-UTF-8 character set, but FMOD did not convert the filename. How can I write an application that can open files with non-ASCII names on all platform?

Since FMOD 4 did not mention UTF-8, on which platforms did the behavior change from FMOD 4 to FMOD 5?

FMOD will convert UTF-8 to a multi-byte wide char on Windows.
Linux should be UTF8 by default AFAIK so the filename is just passed straight through to fopen.

UTF-8 should be supported on all platforms in FMOD Studio (FMOD5).
You can override fmod’s file callbacks with system::setFileSystem if there is an issue, and let us know if there’s an issue. If it is not implemented properly for linux we can look into it.

The situation on Unix is not that simple. You might want to look at the GLib function g_get_filename_charsets or the Qt method QFile::encodeName.

Instead of trying to fix it in FMOD 5 I suggest you list in your documentation all platforms where you convert the filenames from UTF-8 to the native encoding and add a note that the filename is passed as is to the operating system on all other platforms.

I’ve just had a look, it looks like xb1, windows and winstore are the only ones that convert to wide char, the rest just pass it through. Hopefully that’s enough to work with.
Edit: just checked mac, it is utf8 compliant with standard posix functions, so the main issue is just linux and its varying encode formats from the look of it. (rather than having a standard)