Am Dienstag, 24. Oktober 2006 15:37 schrieb Jean-Marc Lasgouttes: > >>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes: > > Georg> This patch resurrects inputenc support. > > It look great to me. The only missing link is being able to export > latex names as fallback, but I do not know how difficult this is.
What do you mean with latex names? If you mean to export some characters like ö to \"o, then this is something I did not look at on purpose. For me it was important that everything that works in 1.4 will also work in 1.5. As I wrote in another mail, exporting unicode characters to LaTeX commands is an additional feature that IMHO is not needed for 1.5 if it is too much work. Or do you mean that something else is missing that was possible in 1.4? > What about docbook? Is this always utf8? AFAIK docbook files can be encoded in utf8, latin1 and a number of other encodings, but all relevant tools are able to process utf8. > Georg> As stated in the comment there is one hack, but it is > Georg> acceptable IMO because the alternative would be to do LaTeX > Georg> export to narrow streams and calling an explicit conversion > Georg> function in every inset. > > From reading the code and comment, I did not understand what happens > at this place of the code. Is this changed comment understandable? if (change_encoding) { lyxerr[Debug::LATEX] << "Converting paragraph to encoding " << language->encoding()->iconvName() << endl; docstring const par = par_stream.str(); // Convert the paragraph to the 8bit encoding that we need to // output. std::vector<char> const encoded = lyx::from_ucs4(par.c_str(), par.size(), language->encoding()->iconvName()); // Interpret this as if it was in the 8 bit encoding of the // document language and convert it back to UCS4. That means // that faked does not contain pure UCS4 anymore, but what // will be written to the output file will be correct, because // the real output stream will do a UCS4 -> document language // encoding conversion. // This is of course a hack, but not a bigger one than mixing // two encodings in one file. // FIXME: Catch iconv conversion errors and display an error // dialog. std::vector<char_type> const faked = lyx::to_ucs4(encoded.data(), encoded.size(), doc_language->encoding()->iconvName()); std::vector<char_type>::const_iterator const end = faked.end(); std::vector<char_type>::const_iterator it = faked.begin(); for (; it != end; ++it) ucs4.put(*it); } If not I have to think more. Georg