cameronbracken/pgfSweave — Issue #38: Support unicode characters.
Author: leonbaum
Created: 2011-10-22 03:41:29+00:00
State: open

Even when using luatex or xetex, it appears that pgfsweave will remove some unicode characters.
For example,
<<>>=
"α"
@
produces the output
[1] ""

There also seems to be a problem sometimes with detecting the encoding.
For example,
<<>>=
α <- 1
@
produces an error:

Error: chunk 1
Error in parse(text = chunk) : 1:0: unexpected input
1: Î
^
In addition: Warning messages:
1: âa.Rnw’ has unknown encoding: assuming Latin-1
2: In strsplit(msg, "\n") : input string 1 is invalid in this locale
Execution halted

My locale is en_US.UTF8, and I have no problems using these unicode characters directly in R and in latex.

> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C
[3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8
[5] LC_MONETARY=C LC_MESSAGES=en_US.utf8
[7] LC_PAPER=en_US.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] tools_2.13.1
> α <- 1
> α
[1] 1
>