Facepunch / garrysmod-issues

Garry's Mod issue tracker
144 stars 56 forks source link

sound.PlayFile fails with unicode file names #2304

Open samuelmaddock opened 8 years ago

samuelmaddock commented 8 years ago

Steps to reproduce:

  1. Copy audio file into garrysmod/sound folder (or anywhere really).
  2. Rename file to contain unicode characters (e.g. マ.mp3).
  3. Run the following command in-game:
lua_run_cl sound.PlayFile( "sound/マ.mp3", "", print )

BASS_StreamCreateFile supports a BASS_UNICODE flag which likely needs to be set.

robotboy655 commented 1 year ago

The issue is actually that the engines' filesystem fails to open files with such names, specifically fopen on Windows.

Kefta commented 1 year ago

https://stackoverflow.com/questions/23285759/fopen-file-name-with-utf8-string-in-windows (last answer) - don't imagine open() has the same issue for posix.