Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a FAQ bullet about system() not marking string output with encoding #7

Open
cderv opened this issue Feb 27, 2023 · 3 comments
Open

Comments

@cderv
Copy link

cderv commented Feb 27, 2023

As a windows user, I encountered several times the issue of executing a command with system() and internal = 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:

In 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.

@gaborcsardi
Copy link
Owner

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.)

@cderv
Copy link
Author

cderv commented Feb 27, 2023

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.

@gaborcsardi
Copy link
Owner

Related: r-lib/processx#353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants