Since I have downloaded the latest version of R (ARM) and Rstudio using homebrew, locales do not properly work on either Rstudio or MacOS terminal.
I did make sure to set the locales properly:
> system("locale")
LANG="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_CTYPE="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_ALL=
> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] ja_JP.UTF-8/ja_JP.UTF-8/ja_JP.UTF-8/C/ja_JP.UTF-8/ja_JP.UTF-8
However, the letters that I tried to show on the screen do not appear in a way that it should be.
> print("日本")
[1] "\u65e5\u672c"
The letters I want to get are Japanese but the output (mix of letters and numbers) seems to be unicode. Note that R and Rstudio worked properly before R was replaced by the ARM version, and the explanation of R which first appears on the screen works well in the language I set.