libretro / LRPS2

GNU General Public License v2.0
165 stars 48 forks source link

ISO Path/filename containing special chars doesn't work #185

Open krizalidzero opened 2 years ago

krizalidzero commented 2 years ago

PCSX2 Core has no "System Language: Japanese" option Expected behavior

It should have a Japanese option Actual behavior

The core is openable, but Japanese ISOs fail to load (they load normally on stand alone PCSX2 1.6, so ISOs and BIOS are not the issue). Steps to reproduce the bug

Start PCSX2 core
Go to its configuration
Check System Language setting and see that Japanese is not available

Bisect Results

From the start [libretro INFO] Bios Found: Japan v01.00(17/01/2000) Console [libretro INFO] Detected BIOS: Japanv01.00(17/01/2000)Console [libretro INFO] No injection data found for Bios "biosfilename" - language: English [libretro ERROR] Could not open File: ��L

Version/Commit

RetroArch: Oct 9 2021 Core downlaoded same day

Environment information

OS: W10
SeventySixx commented 2 years ago

The log shows no injection data found for Bios "biosfilename" because the language injection (language set from Retroarch config) is not implemented for Japanese BIOS, so it will apply always the default language set on the BIOS setup.

I also use Japanese games with Japanese BIOS, and they works, in both English (if available) or Japanese language.

The problem IMO could be another thing:

[libretro ERROR] Could not open File: ��L

Could be the name of the ISO? I don't know if Retroarch PCSX2 core support non UTF-8 chars...

krizalidzero commented 2 years ago

Hi. You seem to be correct. I had my system set up in Japanese and switched to English. The problem persisted. There were no files with Japanese characters or folders. However, one folder had a tilde (ó). Removing the tilde fixed the issue for this particular situation.

I must note that such folder does work with all other systems I have played with no issues, and also with stand alone PCSX2, however.

Would this still be considered as a bug to be fixed? Thank you!

SeventySixx commented 2 years ago

Yeah, I think there is something in the core that don't like some special chars, maybe some string conversions. Yes, it's definitively a bug and it's to be investigated and possibly fixed.

Glad that in the meanwhile you was been able to make it work 👍

SeventySixx commented 2 years ago

Can you please change the title of the issue in something like "ISO Path/filename containing special chars doesn't work"?

So we keep trace of the real cause of the issue and will be fixed in the future

Thanks!

krizalidzero commented 2 years ago

Thank you! I have made the change.

trustmeimanengineer commented 2 years ago

Hi folks,

Encountered the same issue with Japanese characters in ISO file names (the wife has a lot of Japanese games...), and found this ticket - thanks for reporting.

I got it to work by editing the libretro-pcsx2 main.cpp:

This: wxFileName file_name(game->path); Becomes: wxFileName file_name(wxString::FromUTF8(game->path));

This: game_paths.push_back(game->path); Becomes: game_paths.push_back(wxString::FromUTF8(game->path));

This: FILE* fp = fopen(game_paths[0], "rb"); Becomes: FILE* fp = _wfopen(game_paths[0], L"rb");

Appreciate that _wfopen is Windows specific so not suitable for a pull request. Will think about it a bit more. Any thoughts?

Cheers, Richard.

guoyunhe commented 2 years ago

Same here. ISO file path cannot contains non-ASCII characters, otherwise it won't be loaded.