File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def __converter_file(self, user_input: str):
3131                    files .append (f )
3232                for  file  in  files :
3333                    if  file .split ('.' )[- 1 ] in  ['pdf' ]:
34-                         with  open (file , 'r' ) as  fp :
34+                         with  open (file , 'r' ,  encoding = 'utf8' ) as  fp :
3535                            from  crazy_functions .crazy_utils  import  read_and_clean_pdf_text 
3636                            file_content , _  =  read_and_clean_pdf_text (fp )
3737                        what_ask .append ({"role" : "system" , "content" : file_content })
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def minimize_js(common_js_path):
2929            os .remove (old_min_js )
3030        # use rjsmin to minimize `common_js_path` 
3131        c_jsmin  =  rjsmin .jsmin 
32-         with  open (common_js_path , "r" ) as  f :
32+         with  open (common_js_path , "r" ,  encoding = 'utf-8' ) as  f :
3333            js_content  =  f .read ()
3434        if  common_js_path  ==  "themes/common.js" :
3535            js_content  =  inject_mutex_button_code (js_content )
@@ -38,7 +38,7 @@ def minimize_js(common_js_path):
3838        sha_hash  =  hashlib .sha256 (minimized_js_content .encode ()).hexdigest ()[:8 ]
3939        minimized_js_path  =  common_js_path  +  '.min.'  +  sha_hash  +  '.js' 
4040        # save to minimized js file 
41-         with  open (minimized_js_path , "w" ) as  f :
41+         with  open (minimized_js_path , "w" ,  encoding = 'utf-8' ) as  f :
4242            f .write (minimized_js_content )
4343        # return minimized js file path 
4444        return  minimized_js_path 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments