Printing to R console displays additional surrounding characters

Hi dear PGM team !

I’m having a small issue when printing results from my R code to the console, during the execution in RCode : all strings are surrounded by additionnal characters, it makes things impossible to read…

How can I adress this ?
Thanks !

Hi Fabrice !

Could you provide a screenshot of the problem you describe ? And moreover

  • The R version,
  • The RCode version,
  • The Operating System ?

Thank you!


I use windows 10 pro, with RPGM 3.3.3 and R 4.2.1 64bits.

Have you seen this behaviour before ?


Hi !

We have never run into that kind of behavior before. Do basic strings operations like this work?:

> test <- "test"
> test
> print("test")
> cat("test\n")

It sounds like your strings contains some kind of invalid characters that renders like this. Do you read these strings from a file or use a specific function to create them? Can you create a minimal reproducible example for us to try please?

Thank you :slight_smile:

Hi William,

Yes these commands work : it’s only every string (even tab element) will be surrounded by these additional character.
It goes the same with numbers.

My windows is set in English, if that’s any hint ?

Thank you for looking into it !


I just tested on an English Windows and could not reproduce. You can provide a minimal R code example I could run on my computer to reproduce your issue?

Thank you,

Hi William,

Actually : your simple code produces that issue too on my RPGM.

test ← “test”


Could this link be a hint for you ?
r - Why is function returning Data values encoded with ÿþ if used with lapply? - Stack Overflow
I read Markdown and UTF-16 can somehow be linked to the issue.

And this as well:
r - RMarkdown: UTF-8 works with Knit button but not with render() - Stack Overflow

Can you advise on how this can interact with my RConsole in RPGM ?
I’m only having this behaviour in RPGM, not in plain R or even RStudio.

Many thanks !

Ohhh I’m sorry you wrote RCode in your very first post so I was testing everything in RCode. RCode is the editor/IDE and RPGM is the software executing the pgm files.

I was able to reproduce in RPGM 3.3.3 yes, this is due to a breaking change since R 4.2.0 on Windows which changed how R handles character encoding. We have already fixed this for the next upcoming RPGM version scheduled for February.

So if you don’t want to wait until next month for RPGM 4.0.0, you can rollback your R version to R 4.1.3 or an older version and it should work.

Sorry for the inconvenience.

Hi William !
Thank you very much for your quick reply and confirmation on my issue.
I can’t select my underlying R version freely, but I’ll happily wait for the next release of RPGM !

Best regards