On 2011-07-23, Richard Heck wrote: >> I'm now closer to understanding the problem. When I viewed the source >> code in LyX (the LaTeX code) I couldn't see that something in the way >> the files were coded had changed. I used Windows Editor to open the >> two .lyx files, the one before and the one after the compilation, and >> I noticed that the umlauts (I'm writing my paper in German) looked >> normal in the original file (e.g. "ö" and "ü") but in the new file >> they had been transformed into codes (e.g. "ö" and "ü").
Did you open the .lyx files or the .tex files? LyX files are always Unicode and normally UTF-8 encoded. Modern Unix and Windows systems in western locales also normally use UTF-8 encoded Unicode for text files. LyX generated *.tex files can be in any encoding supported by LaTeX: pure ASCII, latin-1, UTF-8 ... >> Now LyX >> didn't seem to have any problems with the coded umlauts although they >> were different from the original file. But the ordinary looking ones >> that appeared in some of the references generated by Bibliographix >> caused the corresponding text passages to disappear in LyX. >> I googled "ö" and found out that it's UTF-8 code. But I don't know >> what to do with that information. >> Obviously, I can use the replace-function of the Editor to transform >> the umlauts into UTF-8 and I suspect that that's as close to a >> solution as I will get with this problem. But I wonder what caused it. > Probably the program that does the replacement saves the file with a > UTF-8 encoding, though it reads it in whatever it already is. I rather suppose it's the other way round: the Bibliographix insertions use an 8-bit encoding wich results in invalid characters if read as UTF-8 by LyX. Is it possible to set the output encoding with Bibliographix? If not, there are also several command line programs that can do the "some 8-bit encoding" -> UTF-8 conversion. > This is bad, since LaTeX doesn't recognize UTF-8. An option is to use > xetex for the final compilation, which does. However, if the problem is really insertions into the *.lyx file these must be UTF-8 encoded. (LyX will recode them for the latex export.) Besides, there is also no need to switch to XeTeX for UTF-8 encoded *.tex files: the UTF-8 encoding is supported by inpuenc. The support is limited, but German umlauts (actually all latin-1 characters) work fine. Non-supported characters are translated to a LaTeX command by LyX's unicodesymbols file. To use UTF-8 encoding in the LyX-generated *.tex file, set Document>Settings>Language>Encoding to (*) other Unicode (utf-8). Günter