Open cderv opened 1 year ago
FWIW, processx::run()
has an encoding
argument, which specifies the encoding of stdout and stderr of the command. (Which processx always re-encodes in UTF-8.)
That is definitely a good argument to use processx.
However, it seems the conversion is removing some characters in the conversion. I can open an issue in processx for that.
As a windows user, I encountered several times the issue of executing a command with
system()
andinternal = TRUE
, then having the surprise of encoding problem. My finding was that string output was not marked with the encoding that the command was using.Example:
systeminfo
in CMD on French windows : https://github.com/rstudio/rsconnect/issues/233pandoc
outputing as UTF-8 which required: https://github.com/rstudio/rmarkdown/issues/2195xfun::system3()
wrapper: https://github.com/yihui/xfun/commit/f8020f19a3d5591fa4f065c3638cd1962f2fb637In all case, a solution was to mark the output with the encoding we expect from the command.
It seems there is no single solution to this problem as it depends on how the command will output, but at least knowing about this helps solves some issues.
Opening this issue for discussion, also if others have experience about this.