mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 06:15:24 +00:00
5e6d91ccc3
Old pugixml versions didn't recode to UTF-8 themselves. Therefore mkvmerge contains code to determine the encoding from the XML declaration's `encoding` attribute and recoding the content to UTF-8 before passing it to pugixml. The old `encoding` attribute was left untouched. Newer pugixml versions do recode to UTF-8. In order to prevent that (and therefore recoding twice), the XML declaration's `encoding` attribute must be set to `UTF-8`.
21 lines
566 B
Ruby
Executable File
21 lines
566 B
Ruby
Executable File
#!/usr/bin/ruby -w
|
|
|
|
# T_355chapters
|
|
describe "mkvmerge / XML chapters"
|
|
|
|
source = "data/subtitles/srt/ven.srt"
|
|
invalid = Dir["data/text/chapters-invalid-*.xml"]
|
|
|
|
# Valid files:
|
|
(Dir["data/text/chapters-*.xml"] - invalid).sort.each do |chapters|
|
|
test_merge "#{source} --chapters #{chapters}"
|
|
end
|
|
|
|
# Invalid files:
|
|
invalid.sort.each do |chapters|
|
|
test chapters do
|
|
messages, _ = merge("#{source} --chapters #{chapters}", :exit_code => :error)
|
|
messages.detect { |line| /The\s+XML\s+chapter\s+file.*contains\s+an\s+error/i.match line } ? :ok : :bad
|
|
end
|
|
end
|