Best practice: Should I try to change to UTF-8 as locale or is it safe to leave it as is?

后端 未结 1 1627
北海茫月
北海茫月 2020-12-04 01:39

I try to set my default encoding to UTF-8; up to now without success:

a <- \"Hallo\"
b <- \"äöfd\"
print(Encoding(a))
# [1] \"unknown\"
print(Encoding(         


        
相关标签:
1条回答
  • 2020-12-04 02:20

    This is not a perfect answer but a good workaround: As Roland pointed out, it might be dangerous to change the locale. So leave it as is. If you have a file and you run into trouble, just search for non-UTF8 encoding as discribed here for RStudio. What I saw, most Editors have such a feature.

    Furthermore, this answer gives more insight in what you can do in case you source() a file.

    For a way to deal with locales when collations play a crucial part see here

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