]> git.lyx.org Git - features.git/commitdiff
- UTF-8 works on Windows as well
authorAsger Ottar Alstrup <alstrup@lyx.org>
Thu, 19 Oct 2006 19:28:27 +0000 (19:28 +0000)
committerAsger Ottar Alstrup <alstrup@lyx.org>
Thu, 19 Oct 2006 19:28:27 +0000 (19:28 +0000)
- We even spit out the right usepackage chant

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15385 a592a061-630c-0410-9148-cb99ea01b6c8

src/bufferparams.C
src/output_latex.C
src/paragraph_pimpl.C

index fa34a76207548fe7ca539e0cae379ca141807d82..a43365cc079c1961f9f622281613731a53b00f5b 100644 (file)
@@ -839,26 +839,32 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                texrow.newline();
        }
 
-       if (inputenc == "auto") {
-               string const doc_encoding =
-                       language->encoding()->latexName();
-
-               // Create a list with all the input encodings used
-               // in the document
-               std::set<string> encodings =
-                       features.getEncodingSet(doc_encoding);
-
-               os << "\\usepackage[";
-               std::set<string>::const_iterator it = encodings.begin();
-               std::set<string>::const_iterator const end = encodings.end();
-               for (; it != end; ++it)
-                       os << lyx::from_ascii(*it) << ',';
-               os << lyx::from_ascii(doc_encoding) << "]{inputenc}\n";
-               texrow.newline();
-       } else if (inputenc != "default") {
-               os << "\\usepackage[" << lyx::from_ascii(inputenc)
-                  << "]{inputenc}\n";
+       // TODO: Some people want to support more encodings than UTF-8. They can have a field day around here
+       if (true) {
+               os << "\\usepackage[utf8]{inputenc}\n";
                texrow.newline();
+       } else {
+               if (inputenc == "auto") {
+                       string const doc_encoding =
+                               language->encoding()->latexName();
+
+                       // Create a list with all the input encodings used
+                       // in the document
+                       std::set<string> encodings =
+                               features.getEncodingSet(doc_encoding);
+
+                       os << "\\usepackage[";
+                       std::set<string>::const_iterator it = encodings.begin();
+                       std::set<string>::const_iterator const end = encodings.end();
+                       for (; it != end; ++it)
+                               os << lyx::from_ascii(*it) << ',';
+                       os << lyx::from_ascii(doc_encoding) << "]{inputenc}\n";
+                       texrow.newline();
+               } else if (inputenc != "default") {
+                       os << "\\usepackage[" << lyx::from_ascii(inputenc)
+                          << "]{inputenc}\n";
+                       texrow.newline();
+               }
        }
 
        if (use_geometry || nonstandard_papersize) {
index 0cde7bef10d2fc287709e367001901f57feffcd8..d739f86176036d5a8f005fc80703e06392f65b0d 100644 (file)
@@ -292,12 +292,14 @@ TeXOnePar(Buffer const & buf,
                }
        }
 
-       if (bparams.inputenc == "auto" &&
-           language->encoding() != previous_language->encoding()) {
-               os << "\\inputencoding{"
-                  << lyx::from_ascii(language->encoding()->latexName())
-                  << "}\n";
-               texrow.newline();
+       if (false) {
+               if (bparams.inputenc == "auto" &&
+                       language->encoding() != previous_language->encoding()) {
+                       os << "\\inputencoding{"
+                          << lyx::from_ascii(language->encoding()->latexName())
+                          << "}\n";
+                       texrow.newline();
+               }
        }
 
        // In an an inset with unlimited length (all in one row),
index 4291cd885081f47cf9475f7e80473facb577c011..b9e7339cd5eb33271b00f7a0a550d195ec73b37b 100644 (file)
@@ -666,7 +666,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                        // I assume this is hack treating typewriter as verbatim
                        if (font.family() == LyXFont::TYPEWRITER_FAMILY) {
                                if (c != '\0') {
-                                       os << c;
+                                       os.put(c);
                                }
                                break;
                        }
@@ -691,7 +691,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                        }
 
                        if (pnr == phrases_nr && c != '\0') {
-                               os << c;
+                               os.put(c);
                        }
                        break;
                }