carsonip / Penguin-Subtitle-Player

An open-source, cross-platform standalone subtitle player
GNU General Public License v3.0
304 stars 38 forks source link

File I/O error in Windows where opening subtitles in different drive #72

Closed mbattaglia closed 4 years ago

mbattaglia commented 4 years ago

Hi, I was trying to play some subtitles and but kept getting a "File I/O" error. After some troubleshooting I realized that I can consistenly reproduce this error if the subtitles are on a different drive (Penguin player in D:/ and files in C:/).

Tried to look for some logs but was not able to find them.

carsonip commented 4 years ago

Hi @mbattaglia, the file IO error popup is only added in v1.3.0. Can you play the subtitle with v1.2.1? I'll look into this issue tomorrow.

mbattaglia commented 4 years ago

Hi, I just tested in v1.2.1 and this issue is not present.

carsonip commented 4 years ago

By "the issue is not present" do you mean you can play the subtitle file successfully? I cannot reproduce this issue in Windows.

mbattaglia commented 4 years ago

What I tried to say is that I can play the subtitles in v1.2.1 even if the .srt file is on another drive than the .exe.

carsonip commented 4 years ago

Is that a stl file or srt file?

mbattaglia commented 4 years ago

I shouldnt log into GitHub before my coffee... I mean a .srt file.

mbattaglia commented 4 years ago

Just added you to a private repo containing a .gif with the walkthrough of the error.

carsonip commented 4 years ago

Thanks for taking the time to create a gif to illustrate the problem. I'll look into it and get back to you once I get something.

carsonip commented 4 years ago

Hi @mbattaglia, sorry for replying so late. I can finally reproduce the issue. It is not a problem about different drives, but more about the file path containing non-ascii character in Windows. I will fix this ASAP. Thanks again for the bug report and the gif.

carsonip commented 4 years ago

Clarification: It happens in Windows only, when the file path contains non-ascii characters. It will cause a problem with the charset detection step. This problem exists prior to 1.3.0, just that 1.3.0 caught the error and displayed it, i.e. charset detection will always fail in Windows if the file path has non-ascii chars. This issue will be fixed in 1.3.1.