recalbox / recalbox-manager

Django project to manage a Recalbox from a web interface
MIT License
14 stars 54 forks source link

Bad filename encoding breaking rom list view #39

Open sveetch opened 8 years ago

sveetch commented 8 years ago

Seems at least on the rom list view, but probably on bios too.

psx bug

sveetch commented 8 years ago

Ok i can't reproduce the bug, it's not an unicode problem because it works nice even with filename written in Kana and probably with every valid unicode (symbols, Cyrillic, etc..).

What i think it's than the user has uploaded files (at least one) with corrupted encoding filename. Until i can reproduce it, i will just put an exception safe block to simply ignore corrupted filename so it does not affect the list process.

Hey @neolao @pasnox @digitalLumberjack @MikaXII @rockaddicted could you help me and try to reproduce it ? Thanks

pasnox commented 8 years ago

Partly easy - mount a ntfs iso latin file system as utf8 on linux. Should present broken encoding. On 20 Dec 2015 00:14, "David THENON" notifications@github.com wrote:

Ok i can't reproduce the bug, it's not an unicode problem because it works nice even with filename written in Kana and probably with every valid unicode (symbols, Cyrillic, etc..).

What i think it's than the user has uploaded files (at least one) with corrupted encoding filename. Until i can reproduce it, i will just put an exception safe block to simply ignore corrupted filename so it does not affect the list process.

Hey @neolao https://github.com/neolao @pasnox https://github.com/pasnox @digitalLumberjack https://github.com/digitalLumberjack @MikaXII https://github.com/MikaXII @rockaddicted https://github.com/rockaddicted could you help me and try to reproduce it ? Thanks

— Reply to this email directly or view it on GitHub https://github.com/recalbox/recalbox-manager/issues/39#issuecomment-166032978 .

sveetch commented 8 years ago

@pasnox oh thanks for the info.

This is pretty difficult for me to reproduce this since i dont have any ntfs nor latin file system FS

sveetch commented 8 years ago

Ok, well for now i will consider this as a "wont fix", will notify about in the README and keeping this bug issue open until 1.2.0, and will close it if not any news

tlanks commented 8 years ago

import sys default_encoding = 'utf-8' if sys.getdefaultencoding() != default_encoding: reload(sys) sys.setdefaultencoding(default_encoding)

tlanks commented 8 years ago

https://docs.python.org/2/howto/unicode.html

sveetch commented 8 years ago

@tlanks i dont really understand what you mean, just know that nowadays we are almost full unicode, and utf-8 is mostly used for output formatting.

All in all, your code wont change anything even if i was able to reproduce the bug on my recalbox.