On 2018-05-10, Jean-Marc Lasgouttes wrote: > Le 05/05/2018 à 23:26, Scott Kostyshak a écrit : >> The reason for this error, from the R perspective, is detailed by this >> r-help ML post [1]. The problem is that when LyX exports the .Rnw file >> (which in turn is used to make the .R file), the .Rnw file is created >> with encoding "iso-8859-1". I think that this encoding is consistent >> with the encoding that we set for creating .tex files that we export (if >> they contain e.g. an "á" character, as is contained in the attached .lyx >> file). However, R does not interpret files in the same way as LaTeX >> engines do. It seems that LaTeX engines automatically handle .tex files >> of various encodings. R, by default, assumes a certain encoding (which >> encoding it assumes depends on the output of Sys.getlocale()). For my >> system, it appears that UTF-8 is assumed.
> Our helper scripts lyxtangle.R/lyxsweave.R and friends set the correct > encoding before running R. Do these scripts also cope with documents that have more than one encoding? Let's assume you have a Russian document with some English parts: then the Russian parts are encoded in koi8-r and the English in iso8859-15. The same with German and Czech, say (iso8859-15 and iso8859-2). Günter