mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 03:47:07 -05:00 
			
		
		
		
	Support Unicode in file names on Windows NT
This commit is contained in:
		@@ -305,7 +305,14 @@ def _encodeFilename(s):
 | 
			
		||||
	"""
 | 
			
		||||
 | 
			
		||||
	assert type(s) == type(u'')
 | 
			
		||||
	return s.encode(sys.getfilesystemencoding(), 'ignore')
 | 
			
		||||
 | 
			
		||||
	if sys.platform == 'win32' and sys.getwindowsversion().major >= 5:
 | 
			
		||||
		# Pass u'' directly to use Unicode APIs on Windows 2000 and up
 | 
			
		||||
		# (Detecting Windows NT 4 is tricky because 'major >= 4' would
 | 
			
		||||
		# match Windows 9x series as well. Besides, NT 4 is obsolete.)
 | 
			
		||||
		return s
 | 
			
		||||
	else:
 | 
			
		||||
		return s.encode(sys.getfilesystemencoding(), 'ignore')
 | 
			
		||||
 | 
			
		||||
class DownloadError(Exception):
 | 
			
		||||
	"""Download Error exception.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user