1.0.2: Fixed MKV muxing problem with UTF-8 subs

This commit is contained in:
Roel van Uden
2015-01-25 12:41:00 +01:00
parent e1bade5992
commit d3559bab07
3 changed files with 4 additions and 4 deletions

View File

@@ -179,7 +179,7 @@ function _subtitle(config, player, filePath, done) {
var format = subtitle.formats[config.format] ? config.format : 'ass';
subtitle.formats[format](data, function(err, decodedSubtitle) {
if (err) return done(err);
fs.writeFile(filePath + '.' + format, decodedSubtitle, done);
fs.writeFile(filePath + '.' + format, '\ufeff' + decodedSubtitle, done);
});
});
}

View File

@@ -31,9 +31,9 @@ module.exports = function(input, done) {
function _event(events) {
var format = 'Layer,Start,End,Style,Name,MarginL,MarginR,MarginV,Effect,Text';
var items = [].concat(events.event).map(function(style) {
return _values(style.$, 'Dialogue: 0,{start},{end},{style},{name},' +
return _values(style.$, 'Dialogue: 0,{start},{end},{style},{name},' +
'{margin_l},{margin_r},{margin_v},{effect},{text}');
});
});
return '[Events]\n' +
'Format: ' + format + '\n' +
items.join('\n') + '\n';