My filesystem is still in latin1, and all the comics I have stored on CDs use latin1 encoding for the file names and directory names. When automatically creating a new collection from a non-UTF8 directory, comix chokes on the non-UTF8 string. Here is a small patch that keeps UTF8 directory names as is, but converts latin1 directory names to UTF8 collection names. It's not much, and I may improve the non-UTF8 support as I go on using comix (I'm new to it).
---filechooser.py.orig2009-04-0320:06:13.000000000+0300+++filechooser.py2010-08-2317:55:12.000000000+0300@@-10,6+10,7@@importlabelsfrompreferencesimportprefsimportthumbnail+importlocale_main_filechooser_dialog=None_library_filechooser_dialog=None@@-261,6+262,13@@directory.""" name = os.path.basename(self.filechooser.get_current_folder())+ try:+ name = unicode(name, 'utf-8')+ except UnicodeDecodeError:+ try:+ name = unicode(name, locale.getdefaultlocale()[1])+ except UnicodeDecodeError:+ pass self._comboentry.child.set_text(name) def files_chosen(self, paths):
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
My filesystem is still in latin1, and all the comics I have stored on CDs use latin1 encoding for the file names and directory names. When automatically creating a new collection from a non-UTF8 directory, comix chokes on the non-UTF8 string. Here is a small patch that keeps UTF8 directory names as is, but converts latin1 directory names to UTF8 collection names. It's not much, and I may improve the non-UTF8 support as I go on using comix (I'm new to it).