Error in inconv(x, "latin1", "ASCII")


I am a research analyst. I use RStudio extensively for our analysis. I have been facing two issues for a while:

  1. I am unable to copy from RStudio and paste into or vice versa to any other programs.
  2. I am facing some kind of a conversion error (screenshot attached, I avoided the screenshot but also felt if I type it out I might miss a few things hence the screenshot).

I tried looking up online however could not find a resolution to these issues. Could I please get some help with this urgently.



1 Like

The best encoding for R is UTF-8. Try converting in terminal with iconv beforehand, which works on the UNIX derivatives. Windows, I don't know.

Look like you're automatically loading the previous session data. Do you need this behavior? Can you try starting a fresh session and see if these errors still happen?

I tried starting a fresh session however that did not work either.

Try unchecking the restore Rdata box . See image below

I tried that out but it does not work

I am using a windows laptop. Thanks though!

Well, what about having a look in your working directory and seeing if there is anything that looks like an .Rdata or .rdata file you can delete? Actually from your first post it looks like you may have a .Rdata file at root or desktop level.

Can you also supply us with the output from



What is your normal working language?


I tried to delete any .rdata files that I had. Please find attached the output from sessionInfo(). I apologize for the screenshots. However since the copy and paste from RStudio would not work, I do not want to risk missing out on any detail.


Thanks. In this case a screenshot is perfectly acceptable :slight_smile:

If I am reading that info correctly your default language is English with UTF-8 encoding. That just eliminated some of the usual suspects.

How in copy and paste working in other programs? Even better, can you open an RMarkdown or Quarto file and see it there is a problem there?
I may be alarmist but is anything else on the computer acting strangely? It may be time to do a major virus sweep.

I'm sorry not to be of more help.

When I try to open a markdown file this is what it asks:


But when I do install the packages it shows the warnings that the prior installation of those packages could not be removed (tried to put up a screenshot but being a new user I am only allowed to embed 1 item).

Nothing seems out of the ordinary with the computer. But, I ran the same code in another computer and it worked there. So it might just be the laptop.

This is likely (I hope) because those packages are already loaded. Try
a reboot and then:

update.packages(ask = FALSE, checkBuilt = TRUE)

it might just be the laptop
Yes, I had to reinstall my entire system a couple of years ago and I still don't know why. And I run Ubuntu!

That does not seem to work either. I might just have to reboot the entire system as well then. Thanks for all your help though!

Best of luck. It is not fun.

1 Like

I suggest to insert this near the top of your code:
options(useFancyQuotes = FALSE)

it will solve if the issue with curly quotes.

I am not using curly quotes in my code but also this also does not solve the issue. Thanks though!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.