简体   繁体   English

在 Rstudio 中,关闭文件选项卡时字符的编码会发生变化

[英]in Rstudio the encoding of characters change when closing the file tab

I have a code with Persian characters, like ( س ) in it.我有一个带有波斯字符的代码,例如( س )。 when I save the file, I get a warning: Not all of the characters could be encoded using ISO8859-1当我保存文件时,我收到警告:并非所有字符都可以使用 ISO8859-1 进行编码

when I close the file tab and reopen it again, the encodings have changed (turned into question marked).当我关闭文件选项卡并再次重新打开时,编码已更改(变成问号)。 BUT , if I close the Rstudio ( without closing the file tab ), in reopening, characters are fine and unchanged.但是,如果我关闭 Rstudio (不关闭文件选项卡),在重新打开时,字符很好并且没有变化。

saving with other encodings like utf-8 code didn't help.使用其他编码(如 utf-8 代码)保存并没有帮助。

any idea why this is happening and what should I do?知道为什么会这样,我该怎么办?

save with encoding cp1256 and reopen with encoding (same cp1256) solved it使用编码 cp1256 保存并使用编码重新打开(相同的 cp1256)解决了它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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