melonDS-emu / melonDS

DS emulator, sorta
https://melonds.kuribo64.net
GNU General Public License v3.0
3.33k stars 544 forks source link

Certain special characters in filenames within archives cause ROM load failure #1690

Open CasualPokePlayer opened 1 year ago

CasualPokePlayer commented 1 year ago

image

Results in failing to load the ROM as it cannot understand the extension for whatever reason. Both zip/7z seem to have issues with this (haven't tested .rar as 7zip can't create those). Not all special characters seem to have an issue, é seems to be fine, but (for example) 金 is not (maybe all CJK is like this?)

Seems to be a Windows issue, trying the same on Linux seems to result in the ROM loading up fine.

patataofcourse commented 1 year ago

is this from the CLI, the GUI, or both?

CasualPokePlayer commented 1 year ago

Any (also, these are from the names inside the archive, not the name of the archive itself)

RupeeClock commented 5 months ago

The issue seems to be that melonDS 0.9.5 cannot parse certain characters in filenames on Windows. I'm using Windows 10 Pro version 22H2. ポケモン不思議のダンジョン 青の救助隊 [DAXJ01].nds will fail, same as a Pokémon Mystery Dungeon Explorers of Sky [DA4P01].nds, but not a Pokemon Mystery Dungeon Explorers of Sky [DA4P01].nds. with the accented é replaced. This occurs whether you launch the .nds file via Explorer using file association with the melonDS executable, or via CMD with melonDS as a CLI application.

This does not appear to affect the libretro melonDS 0.9.3 core when used with Retroarch 1.19.1, as long as you load the content from within the Retroarch GUI. If using Ctrl+O to load content via Windows Explorer's Open File dialogue, this can then run into the same issue of being unable to load content from files with filenames containing special characters. This isn't exclusive to the melonDS core, I was able to reproduce this when using the mGBA core.

Curiously, using drag-and-drop from an Explorer window works for both melonDS standalone and as a libretro core in Retroarch. This will allow the ROM to boot from a file using special characters in the filename. Other Windows applications I've used do not have this filename character issue, such as the standalone mGBA 0.10.0 executable. I wonder if it's a file system API that both Retroarch and melonDS are using that has this issue when using Open Dialogues or Explorer File Association?

RSDuck commented 5 months ago

There has been a bit of back and forth with this type of issue, but I think it should be fixed for all cases on latest source. See also https://github.com/melonDS-emu/melonDS/issues/1556 and https://github.com/melonDS-emu/melonDS/commit/18d1df606f475c49bf7bfc6cdbbbdb9208e0e7df