mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-03 22:47:06 -05:00 
			
		
		
		
	[utils] Add encode_compat_str
This commit is contained in:
		@@ -1712,6 +1712,10 @@ def encode_dict(d, encoding='utf-8'):
 | 
			
		||||
    return dict((encode(k), encode(v)) for k, v in d.items())
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def encode_compat_str(string, encoding=preferredencoding(), errors='strict'):
 | 
			
		||||
    return string if isinstance(string, compat_str) else compat_str(string, encoding, errors)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
US_RATINGS = {
 | 
			
		||||
    'G': 0,
 | 
			
		||||
    'PG': 10,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user