简体   繁体   中英

How do you use special letters (danish) in R-studio?

I am from Denmark and need to be able to use danish letters in my R-code.

If I add some code like:

print("Århus er bare øv...")

and save it as an R-script file in R-studio, the next time I open the file in R-studio I get:

print("?rhus er bare ?v...")

When saving your file, use File -> Save with encoding and select eg "UTF-8". If the file is read incorrectly next time, use File -> Reopen with encoding.

You may also change the RStudio preferences (Tools -> Global options / General->Default text encoding) and set "UTF-8".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM