ChaoYang
ChaoYang

Reputation: 847

How to change the character encoding of .R file in RStudio?

I want to save all .R file in one type of encoding, it is inconvenient to switch encodings everytimes I open a file, so, how to change the character encoding of .R file in RStudio?

Upvotes: 7

Views: 34656

Answers (3)

Maria Wollestonecraft
Maria Wollestonecraft

Reputation: 496

R 3.4.3; RStudio 1.1.383

Tools > Global Options > Code > Saving > "Default text encoding" [Change]

enter image description here

Upvotes: 10

James
James

Reputation: 66834

Tools - Options - General - Default text encoding:

enter image description here

Upvotes: 4

Pop
Pop

Reputation: 12401

You can try this. Go in "File" menu and then "Save with encoding..."

Upvotes: 5

Related Questions