load_font->set_attribute ("URI", (*i)->uri);
}
- subtitles_as_xml (root, 250, "");
+ subtitles_as_xml (root, 250, INTEROP);
return doc.write_to_string_formatted ("UTF-8");
}
BOOST_FOREACH (shared_ptr<InteropLoadFontNode> i, _load_font_nodes) {
boost::filesystem::path file = p.parent_path() / i->uri;
- FILE* f = fopen_boost (file, "w");
+ FILE* f = fopen_boost (file, "wb");
if (!f) {
throw FileError ("could not open font file for writing", file, errno);
}
list<Font>::const_iterator j = _fonts.begin ();
- while (j->load_id != i->id) {
+ while (j != _fonts.end() && j->load_id != i->id) {
++j;
}
if (j != _fonts.end ()) {