FunKiiU icon indicating copy to clipboard operation
FunKiiU copied to clipboard

Unknown character stops all downloads

Open Bryce-Dixon opened this issue 8 years ago • 10 comments

For example, 000500001011a400 is "Super Street Fighter Ⅱ" where that Ⅱ can't be interpreted and crashes the program.

This is especially an issue with -region

At the very least, adding an -ignore TITLE1 TITLE2 ... would allow people to manually circumvent the issue.

Bryce-Dixon avatar Nov 18 '16 10:11 Bryce-Dixon

When does it crash? During folder creation time? A stack trace might be helpful as well to see which line of code if causing the issue. I dont understand why it wouldn't just be interpreted as two capital 'i' (II). There are still some unicode issues I believe so it might be related. If it works fine in python 3 and not python 2 then that's probably the case. Is it broken on both versions?

dojafoja avatar Nov 19 '16 16:11 dojafoja

I'm gonna run a few tests and see if its just the print statement breaking it. I'm wondering if since print() wraps stdout maybe it has something to do with the users terminal encoding and not python itself.

dojafoja avatar Nov 19 '16 20:11 dojafoja

Ⅱ isn't two "I"s, it's 1 character. I'm not a python dev, but it may be that it's just an obscure Unicode character and the terminal having an issue with it (Trying to paste the char into my terminal resulted in a "?").

https://en.wiktionary.org/wiki/Ⅱ

Bryce-Dixon avatar Nov 20 '16 04:11 Bryce-Dixon

Ya I'm not an expert in unicode but its definitely an obscure unicode character. I'm also having issues populating a combobox in tk with the same titles.

dojafoja avatar Nov 20 '16 06:11 dojafoja

This issue definitely has something to do with printing to the users terminal and it's encoding. The print statement on line 116 is what breaks and the exact same output prints just fine in IDLE's terminal.

dojafoja avatar Nov 23 '16 22:11 dojafoja

It also prints fine in linux. It also does not happen when entering key manually using -key argument. I'm gonna try a couple things.

dojafoja avatar Nov 23 '16 22:11 dojafoja

It also does not happen when entering key manually using -key argument

Yeah, but that doesn't really help when using the -region arg.

Modifying line 116 by removing the title fixes the issue.

Bryce-Dixon avatar Nov 28 '16 05:11 Bryce-Dixon

I think the best solution right now would be a try: except UnicodeEncodeError: block where it tries to print normally and if above exception is raised then wrap outfname with repr() So far this is the best solution ive worked out since we dont know if a users terminal supports the character or not. printing repr(outfname) will stop it from breaking while still printing the title name, if it has unprintable char in it.

dojafoja avatar Nov 28 '16 19:11 dojafoja

I will submit a pull request today

dojafoja avatar Nov 28 '16 19:11 dojafoja

It seems that if this is the right solution, it should be applied to the log function. I thought this error could be more consistently handled by changing this print to a log, since log's ostensible purpose is to handle this output encoding.

nexusmtz avatar Jan 25 '17 07:01 nexusmtz