fix parsing config file
This commit is contained in:
		
							parent
							
								
									731de491d2
								
							
						
					
					
						commit
						83c63e85de
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -17,6 +17,7 @@
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
 | 
					import locale
 | 
				
			||||||
from common import gajim
 | 
					from common import gajim
 | 
				
			||||||
from common import i18n
 | 
					from common import i18n
 | 
				
			||||||
_ = i18n._
 | 
					_ = i18n._
 | 
				
			||||||
| 
						 | 
					@ -52,7 +53,10 @@ class OptionsParser:
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for line in fd.readlines():
 | 
							for line in fd.readlines():
 | 
				
			||||||
			line = line.decode('utf-8')
 | 
								try:
 | 
				
			||||||
 | 
									line = line.decode('utf-8')
 | 
				
			||||||
 | 
								except UnicodeDecodeError:
 | 
				
			||||||
 | 
									line = line.decode(locale.getpreferredencoding())
 | 
				
			||||||
			self.read_line(line)
 | 
								self.read_line(line)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		fd.close()
 | 
							fd.close()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue