From d3559bab07fbc386c7607f60f0beca6a1c7215f6 Mon Sep 17 00:00:00 2001 From: Roel van Uden Date: Sun, 25 Jan 2015 12:41:00 +0100 Subject: [PATCH] 1.0.2: Fixed MKV muxing problem with UTF-8 subs --- package.json | 2 +- src/episode.js | 2 +- src/subtitle/formats/ass.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9f8747c..5a999db 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ ], "name": "crunchyroll", "repository": "git://github.com/Deathspike/crunchyroll.js.git", - "version": "1.0.1", + "version": "1.0.2", "bin": { "crunchyroll": "./bin/crunchyroll" }, diff --git a/src/episode.js b/src/episode.js index e4b7d4c..694be5a 100644 --- a/src/episode.js +++ b/src/episode.js @@ -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); }); }); } diff --git a/src/subtitle/formats/ass.js b/src/subtitle/formats/ass.js index 0a1eab0..01628d8 100644 --- a/src/subtitle/formats/ass.js +++ b/src/subtitle/formats/ass.js @@ -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';