From 4a354aa59ed8b7487286c2f506b644add0ed5e8f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 11 Nov 2014 14:27:01 +0100 Subject: [PATCH] srt newlines are \r\n; add utf-8 BOM, fixes #2556 --- source/Ox/js/Format.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Ox/js/Format.js b/source/Ox/js/Format.js index b0d1f914..a0ad55b1 100644 --- a/source/Ox/js/Format.js +++ b/source/Ox/js/Format.js @@ -744,15 +744,15 @@ Ox.formatRoman = function(number) { Ox.formatSRT Formats subtitles as SRT @*/ Ox.formatSRT = function(subtitles) { - return Ox.sortBy(subtitles, ['in', 'out']).map(function(subtitle, index) { + return '\ufeff' + Ox.sortBy(subtitles, ['in', 'out']).map(function(subtitle, index) { return [ index + 1, ['in', 'out'].map(function(key) { return Ox.formatDuration(subtitle[key], 3).replace('.', ','); }).join(' --> '), subtitle['text'] - ].join('\n') - }).join('\n\n'); + ].join('\r\n') + }).join('\r\n\r\n'); }; /*@