Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-17-2020, 12:54 AM   #1
cuser
Junior Member
cuser began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2020
Device: kindle
calibre-utf8-path

https://github.com/snomiao/calibre-utf8-path

backend.py
filenames.py

Code:
def replace_invalid_filename_char(filename, replaced_char=''):
    '''Replace the invalid characaters in the filename with specified characater.
    The default replaced characater is '_'.
    e.g.
    C/C++ -> C_C++
    '''
    valid_filename = filename
    invalid_characaters = '\/:*?"<>|'
    for c in invalid_characaters:
        valid_filename = valid_filename.replace('【', '[')
        valid_filename = valid_filename.replace('】', ']')
        valid_filename = valid_filename.replace(c, replaced_char)
    return valid_filename
Code:
    def delete_originals(self):
        import win32file
        for path in self.handle_map:
            #win32file.DeleteFileW(path)
            os.remove(path)
        self.close_handles()
cuser is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-350 About the epub custom font path And how to know the path? 52manhua Sony Reader Dev Corner 6 12-20-2013 01:28 AM
Default Path Calibre Themus Calibre 2 08-12-2010 10:44 PM
utf8 problem in the path adding books thcuvelier Calibre 1 02-01-2010 10:51 AM
Calibre doesn't display UTF8 characters jerrry94087 Calibre 1 01-02-2010 07:46 AM
Calibre in Windows path banjomike Calibre 13 09-04-2009 12:58 PM


All times are GMT -4. The time now is 01:21 PM.


MobileRead.com is a privately owned, operated and funded community.