Fix LaTeX generation of files with inputenc == default.

See the patch itself for further comments.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16421 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-12-29 09:24:18 +00:00
parent fcd3b56a22
commit 67dd949130
3 changed files with 17 additions and 6 deletions

View File

@ -78,8 +78,9 @@ LyX file-format changes
encoding of the LyX file: encoding of the LyX file:
\inputencoding LyX file encoding \inputencoding LyX file encoding
auto as determined by the document language auto as determined by the document language(s)
default latin1 default unspecified 8bit (treated as latin1 internally,
see comment in bufferparams.h)
everything else as determined by \inputencoding everything else as determined by \inputencoding
2006-07-03 Georg Baum <Georg.Baum@post.rwth-aachen.de> 2006-07-03 Georg Baum <Georg.Baum@post.rwth-aachen.de>

View File

@ -1468,9 +1468,16 @@ Encoding const & BufferParams::encoding() const
{ {
if (inputenc == "auto") if (inputenc == "auto")
return *(language->encoding()); return *(language->encoding());
Encoding const * const enc = encodings.getFromLaTeXName(inputenc); Encoding const * const enc = (inputenc == "default") ?
encodings.getFromLyXName("iso8859-1") :
encodings.getFromLaTeXName(inputenc);
if (enc) if (enc)
return *enc; return *enc;
if (inputenc == "default")
lyxerr << "Could not find iso8859-1 encoding for inputenc "
"value `default'. Using inputenc `auto' instead."
<< endl;
else
lyxerr << "Unknown inputenc value `" << inputenc lyxerr << "Unknown inputenc value `" << inputenc
<< "'. Using `auto' instead." << endl; << "'. Using `auto' instead." << endl;
return *(language->encoding()); return *(language->encoding());

View File

@ -180,7 +180,10 @@ public:
* The input encoding for LaTeX. This can be one of * The input encoding for LaTeX. This can be one of
* - auto: find out the input encoding from the used languages * - auto: find out the input encoding from the used languages
* - default: Don't load the inputenc package and hope that it will * - default: Don't load the inputenc package and hope that it will
* work (unlikely) * work (unlikely). The encoding is an unspecified 8bit encoding,
* the interpretation is up to the LaTeX compiler. Because we need
* a rule how to create this from our internal UCS4 encoded
* document contents we treat this as latin1 internally.
* - any encoding supported by the inputenc package * - any encoding supported by the inputenc package
* The encoding of the LyX file is always utf8 and has nothing to * The encoding of the LyX file is always utf8 and has nothing to
* do with this setting. * do with this setting.