decode correctly string under linux AND windows. Fixes #1375
This commit is contained in:
		
							parent
							
								
									fc1d6ff280
								
							
						
					
					
						commit
						3dfba9098d
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -266,7 +266,11 @@ _('Connection with peer cannot be established.'))
 | 
			
		|||
				file_dir = None
 | 
			
		||||
				files_path_list = dialog.get_filenames()
 | 
			
		||||
				for file_path in files_path_list:
 | 
			
		||||
					file_path = file_path.decode('utf8')
 | 
			
		||||
					# decode as UTF-8 under win
 | 
			
		||||
					if os.name == 'nt':
 | 
			
		||||
						file_path = file_path.decode('utf8')
 | 
			
		||||
					else:
 | 
			
		||||
						file_path = file_path.decode(sys.getfilesystemencoding())
 | 
			
		||||
					if self.send_file(account, contact, file_path) and file_dir is None:
 | 
			
		||||
						file_dir = os.path.dirname(file_path)
 | 
			
		||||
				if file_dir:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue