[utils] Use bytes-like objects in dfxp2srt
This fixes handling of non-UTF8 TTML subtitles Closes #14191
This commit is contained in:
		
							parent
							
								
									68d43a61b5
								
							
						
					
					
						commit
						3869028ffb
					
				
					 4 changed files with 41 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -585,7 +585,7 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
 | 
			
		|||
                dfxp_file = old_file
 | 
			
		||||
                srt_file = subtitles_filename(filename, lang, 'srt')
 | 
			
		||||
 | 
			
		||||
                with io.open(dfxp_file, 'rt', encoding='utf-8') as f:
 | 
			
		||||
                with open(dfxp_file, 'rb') as f:
 | 
			
		||||
                    srt_data = dfxp2srt(f.read())
 | 
			
		||||
 | 
			
		||||
                with io.open(srt_file, 'wt', encoding='utf-8') as f:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue