Czech encoding in R

前端 未结 2 1624
甜味超标
甜味超标 2021-01-19 04:12

I have installed RStudio on a new computer, and has developed encoding issues. When I type accented text in console (no file writing or reading involved, just plain console)

相关标签:
2条回答
  • Perhaps:

    new.locale <- ifelse(.Platform$OS.type=="windows", "Czech_Czech Republic.1250", "en_US.UTF-8")
    Sys.setlocale("LC_CTYPE", new.locale) 
    

    Also learn to specify your OS.

    0 讨论(0)
  • 2021-01-19 05:05

    For the benefit of posterity - I overcame my problem by setting code page to 1250 (while keeping US English as my language).

    if (.Platform$OS.type == 'windows') {
      Sys.setlocale(category = 'LC_ALL','English_United States.1250')
    } else {
      Sys.setlocale(category = 'LC_ALL','en_US.UTF-8')
    }
    

    in the .Rprofile

    0 讨论(0)
提交回复
热议问题