]> git.lyx.org Git - features.git/blobdiff - src/Buffer.cpp
* docstream: factorize out some code and introduce odocfstream::reset()
[features.git] / src / Buffer.cpp
index 0b2c71b1cc86111e305c21950318032de4ea180a..7ab95e8f0ea53360609a82439d2add74e86ac26e 100644 (file)
@@ -1009,7 +1009,15 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
        string const encoding = runparams.encoding->iconvName();
        LYXERR(Debug::LATEX, "makeLaTeXFile encoding: " << encoding << "...");
 
-       odocfstream ofs(encoding);
+       odocfstream ofs;
+       try { ofs.reset(encoding); }
+       catch (iconv_codecvt_facet_exception & e) {
+               lyxerr << "Caught iconv exception: " << e.what() << endl;
+               Alert::error(_("Iconv software exception Detected"), bformat(_("Please "
+                       "verify that the support software for your encoding (%1$s) is "
+                       "properly installed"), from_ascii(encoding)));
+               return false;
+       }
        if (!openFileWrite(ofs, fname))
                return false;