use locale.getpreferredencoding() instead of sys.getfsencoding in decode_string
This commit is contained in:
		
							parent
							
								
									c494b7f5b9
								
							
						
					
					
						commit
						fa20b21507
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -17,6 +17,7 @@ | |||
| ## | ||||
| 
 | ||||
| import sre | ||||
| import locale | ||||
| import os | ||||
| import subprocess | ||||
| import urllib | ||||
|  | @ -553,7 +554,7 @@ def decode_string(string): | |||
| 	if isinstance(string, unicode): | ||||
| 		return string | ||||
| 	# by the time we go to iso15 it better be the one else we show bad characters | ||||
| 	encodings = (sys.getfilesystemencoding(), 'utf-8', 'iso-8859-15') | ||||
| 	encodings = (locale.getpreferredencoding(), 'utf-8', 'iso-8859-15') | ||||
| 	for encoding in encodings: | ||||
| 		try: | ||||
| 			string = string.decode(encoding) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue