convert the final result from its encoding (if it's not unknown) to the encoding provided by the user
a new function native_encode() to convert strings to the native encoding of the system

code factored out from block_exec()
use the native encoding when processing the input files (at least) to make regular expressions work
make sure the encoding is not case-sensitive to other software packages such as LyX
use writeLines() instead of cat() to guarantee the output with correct encoding (useBytes = TRUE)
since writeLines() is used, we no longer need to make sure the document output is a character scalar with \n in the end
bump version