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?

Yes. https://bitbucket.org/oscaremr/oscar/src/stable/src/main/java/oscar/oscarBilling/ca/bc/Teleplan/TeleplanAPI.java

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:

https://bitbucket.org/oscaremr/oscar/src/7c4794bc81b0346e00241b5721de86953c9a97f8/src/main/java/oscar/oscarBilling/ca/bc/Teleplan/TeleplanAPI.java#lines-231

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 TeleplanAPI.java
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.