Rstudio Editor editor declares invalid or multibyte error on opening

Rstudio 1.3.172 running on Ubuntu 18 declares an error on attempting to open a .java file:

"Invalid or incomplete multibyte or wide character"

and then fails (quite sensibly given the error) to load the file to the editor.

However, when I open the same file in vi I see no multibyte characters.

Could they be hiding?
Should I be searching for an incomplete or invalid multi-byte or wide in some way other than simple visual inspection?
What might be triggering Rstudio to detect this condition other than the stated error?

Any suggestions?

Any chance you could share the file with us, so we could try and reproduce?


I am running Rstudio IDE 1.3.299 on an unremarkable Ubuntu 18. box.

It looks like an escape character ^X was written in the "MODE" string here:

and that is causing RStudio to detect this as a 'binary' file. In particular, it causes the file utility to believe that the file is binary, e.g.

$ file --dereference --mime --brief
application/octet-stream; charset=binary

Removing that character seems to fix things up for me.

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