diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/subrip_reader.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc index 5e9e010..3f1c23d 100644 --- a/src/subrip_reader.cc +++ b/src/subrip_reader.cc @@ -54,6 +54,17 @@ SubripReader::SubripReader (FILE* f) line = string (buffer); trim_right_if (line, boost::is_any_of ("\n\r")); + if ( + line.length() >= 3 && + static_cast<unsigned char> (line[0]) == 0xef && + static_cast<unsigned char> (line[1]) == 0xbb && + static_cast<unsigned char> (line[2]) == 0xbf + ) { + + /* Skip Unicode byte order mark */ + line = line.substr (3); + } + switch (state) { case COUNTER: { |
