When trying to parse a character vector with strings containing non-ASCII characters, I get a different behaviour vector returned by rpy2 than when running it natively in R.
When running it natively in R, I get the following behaviour:
> c("ä", "ö", "ü")  "ä" "ö" "ü"
When running the same using rpy2, I get the following characters returned:
In : robjects.r("c('ä', 'ö', 'ü')") Out: R object with classes: ('character',) mapped to: ['Ã¤', 'Ã¶', 'Ã¼']
The locale ("LC_ALL") is set to 'en_US.UTF-8'.
I can reproduce this behaviour on both Linux and Mac OS X with Python v3.7.2, R v3.5.2 and rpy2 v3.0.1.
Is there a way to enforce UTF-8 encoding for R objects processed by rpy2?