문제

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 e.g. "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".

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top