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

Shell Exec can't execute command with LATIN1 encondig #1094

Open
FeehGb opened this issue May 4, 2022 · 1 comment
Open

Shell Exec can't execute command with LATIN1 encondig #1094

FeehGb opened this issue May 4, 2022 · 1 comment
Labels
exec Issues specific to the shell.exec() API fix Bug/defect, or a fix for such a problem

Comments

@FeehGb
Copy link

FeehGb commented May 4, 2022

Node version (or tell us if you're using electron or some other framework):

v14.17.4

ShellJS version (the most recent version/Github branch you see the bug on):

^0.8.5

Operating system:

Ubuntu 20.04

Description of the bug:

When I tried to execute a command with string in latin1 ecoding, always execute in UTF-8;

Example ShellJS command to reproduce the error:

const shell     = require('shelljs');
const Iconv = require('iconv').Iconv

const string = 'ééé'
const iconv = new Iconv('UTF-8', 'latin1');
const comando = iconv.convert(`echo ${string}`);

shell.exec(comando.toString()+'ééé  > output.txt' ,{encoding:'latin1'})

The output terminal in LATIN1 enconding

���ééé

The output terminal in UTF-8

���-ééé
@nfischer nfischer added the exec Issues specific to the shell.exec() API label May 22, 2022
@nfischer nfischer added the fix Bug/defect, or a fix for such a problem label May 30, 2022
@FeehGb
Copy link
Author

FeehGb commented Nov 24, 2022

I found way to execute;
I created a file with ISO-8859-1 e put the command save with .sh and execute;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exec Issues specific to the shell.exec() API fix Bug/defect, or a fix for such a problem
Projects
None yet
Development

No branches or pull requests

2 participants