Hi,

I just committed a few fixes to get UTF-8 latex export working.

Regards,
Asger
Index: bufferparams.C
===================================================================
--- bufferparams.C      (revision 15381)
+++ bufferparams.C      (working copy)
@@ -839,26 +839,32 @@
                texrow.newline();
        }
 
-       if (inputenc == "auto") {
-               string const doc_encoding =
-                       language->encoding()->latexName();
+       // 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);
+                       // 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();
+                       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: mathed/InsetMathMBox.C
===================================================================
--- mathed/InsetMathMBox.C      (revision 15381)
+++ mathed/InsetMathMBox.C      (working copy)
@@ -25,10 +25,10 @@
 #include "paragraph.h"
 #include "texrow.h"
 
+using lyx::odocstream;
 using std::auto_ptr;
 using std::endl;
 
-
 InsetMathMBox::InsetMathMBox(BufferView & bv)
        : text_(&bv), bv_(&bv)
 {
@@ -73,7 +73,7 @@
                ws << "}";
        } else {
                ws << "\\mbox{\n";
-               text_.write(*bv_->buffer(), ws.os());
+//             text_.write(*bv_->buffer(), ws.os());
                ws << "}";
        }
 }
Index: output_latex.C
===================================================================
--- output_latex.C      (revision 15381)
+++ output_latex.C      (working copy)
@@ -292,12 +292,14 @@
                }
        }
 
-       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: paragraph_pimpl.C
===================================================================
--- paragraph_pimpl.C   (revision 15381)
+++ paragraph_pimpl.C   (working copy)
@@ -666,7 +666,7 @@
                        // 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 @@
                        }
 
                        if (pnr == phrases_nr && c != '\0') {
-                               os << c;
+                               os.put(c);
                        }
                        break;
                }

Reply via email to