Developing Package R Using UTF-8 on Windows

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?

+7
windows r utf-8 character-encoding
source share

No one has answered this question yet.

See related questions:

2453
How to install pip on Windows?
2195
Is there an equivalent of "which" on the windows command line?
1975
How do I know which process the port is listening on in Windows?
1141
How can I develop for iPhone using a Windows development machine?
1140
Utf-8 all through
674
What is the difference between UTF-8 and UTF-8 without specification?
389
Work with UTF-8 encoding in Python source code
67
JSON character encoding - supported by UTF-8 browsers or do I need to use numeric escape sequences?
26
Loading utf-8 encoded text into a MySQL table
0
UTF-8-encoded MediaFileUpload HTML using Python and Google-Drive-SDK

All Articles