I am not in an English-speaking country. We need to be able to develop our local language in our code.
I am trying to develop a package, but the encoding problem. A package is just a way to organize my code. This means that it contains magic strings for column names and data values, for example:
data %>% select("Γ
sen", Region) %>% filter(Region == "Γ
holt")
This code wrapped in the function defined in my package will fail if Γ
is converted to some strange characters when I try to run it, as a result of which it will fail because there is no column or data containing the specified strange characters.
All my source code files use UTF-8 encoding.
Development in English is not an option.
I have the following set in my DESCRIPTION file:
Depends: R (>= 3.30) Encoding: UTF-8
Edit:
Using options(encoding = "UTF-8") at the top of my main script from which I am invoking my package seems to fix the problem of having non-ascii characters in my package code.
Can anyone who knows about this shed light on this?
windows r utf-8 character-encoding
Codemonkey
source share