I'm currently writing a .tex report with my wife. She's on a Windows machine and I'm running Linux over here; we've decided to encode our report in ISO-8859-1 (i.e., we use \usepackage[latin1]{inputenc} on the preamble).
We're also generating lots of tables in R using xtable() and some other customized functions to output LaTeX. Whenever I sink an R output, I use this command: sink(file("filename.tex", encoding = "ISO-8856-9")). There is, however, this one long table that contains lots of special characters. Whenever I try to sink this table as ISO I get this message:
Warning message:
invalid char string in output conversion
Even though it's just a warning, it prevents our LaTeX compiler from being able to correctly parse the command \input{filename.tex}.
The workaround we have for this is using encoding = "UTF-8" in R, then opening the file on a text editor and saving it with ISO encoding. Then LaTeX compiles the file correctly with apparently all special characters.
Is there a command by which I can tell LaTeX that a file I'm inputting has a different encoding from the main LaTeX file? In my mind, it would look something like this \input[utf8]{filename.tex} (but unfortunately \input or it's fellow \include don't take options).