fix part of ticket #6142: avoid a memory access error when an encoding is unkonwn

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31222 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-08-24 22:06:51 +00:00
parent a457aa2057
commit eef60e5197

View File

@ -154,7 +154,11 @@ Parser::~Parser()
void Parser::setEncoding(std::string const & e)
{
Encoding const * enc = encodings.fromLaTeXName(e);
//cerr << "setting encoding to " << enc->iconvName()<<std::endl;
if (!enc) {
cerr << "Unknown encoding " << e << ". Ignoring." << std::endl;
return;
}
//cerr << "setting encoding to " << enc->iconvName() << std::endl;
is_ << lyx::setEncoding(enc->iconvName());
encoding_latex_ = e;
}