nwoltman / srt-to-vtt-cl

A command line tool that converts subtitle files from SubRib (.srt) format to WebVTT (.vtt) format
MIT License
95 stars 11 forks source link

Different encoding is randomly detected for the same input file #5

Closed sandersaares closed 8 years ago

sandersaares commented 8 years ago

The file encoding appears to be randomly determined when processing this file: http://durian.blender.org/wp-content/content/subtitles/sintel_en.srt

The file is UTF-8, so the output in the case UTF16 is detected is, of course, gibberish.

Log displayed below:

Searching for files to convert in: .
Converting file: .\sintel_en.srt => .\sintel_en.vtt ... UTF16_LE_NOBOM text encoding detected.  done!

c:\Source\x\x\x\bin\Release>srt-vtt.exe
Searching for files to convert in: .
Converting file: .\sintel_en.srt => .\sintel_en.vtt ... No text encoding detected.  done!

c:\Source\x\x\x\bin\Release>srt-vtt.exe
Searching for files to convert in: .
Converting file: .\sintel_en.srt => .\sintel_en.vtt ... No text encoding detected.  done!

c:\Source\x\x\x\bin\Release>srt-vtt.exe
Searching for files to convert in: .
Converting file: .\sintel_en.srt => .\sintel_en.vtt ... No text encoding detected.  done!

c:\Source\x\x\x\bin\Release>srt-vtt.exe
Searching for files to convert in: .
Converting file: .\sintel_en.srt => .\sintel_en.vtt ... No text encoding detected.  done!

c:\Source\x\x\x\bin\Release>srt-vtt.exe
Searching for files to convert in: .
Converting file: .\sintel_en.srt => .\sintel_en.vtt ... UTF16_LE_NOBOM text encoding detected.  done!```
nwoltman commented 8 years ago

@sandersaares Thanks for finding this! I've fixed this in the code and I will be releasing a new version soon.

nwoltman commented 8 years ago

@sandersaares Sorry I should have mentioned this earlier; version 1.2.0 which includes this fix has been released.