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

Exec while encoding as buffer still contains question marks instead of special characters #20871

Closed
mm739521 opened this issue May 21, 2018 · 1 comment
Labels
wrong repo Issues that should be opened in another repository.

Comments

@mm739521
Copy link

mm739521 commented May 21, 2018

  • Version:6.10.3
  • Platform:Windows

I'm attempting to echo a string with special characters in it (téstér) with the child_process.exec(command[, options][, callback]) .

stdout is returning t?st?r. As per instructions I added the {encoding: 'buffer'} which is returning the buffer value of <Buffer 74 82 73 74 82 72 0d 0a>. If I create a new Buffer object using let test = Buffer.from('téstér') I get back the value of <Buffer 74 c3 a9 73 74 c3 a9 72>.

Why are these returning different values? I'm about to decode the value from the Buffer.from object I create, with the special characters, but when I attempt to do the same to the stdout I still get the t?st?r value.

Am I doing something incorrect here? Any help would be greatly aprreciated.

It seems the {encoding: 'buffer'} is treating the é as 82. Which is a linebreak according to this https://www.fileformat.info/info/unicode/char/0082/index.htm

@mscdex
Copy link
Contributor

mscdex commented May 21, 2018

This issue tracker is for reporting bugs in node core and submitting feature requests for node core.

General help questions should be posted to the nodejs/help issue tracker instead.

Issues with third-party modules, npm, or other tools that use node, should be posted to the appropriate issue tracker for that project, unless it can be proven that the issue is in fact with node core and not the module/tool in question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

2 participants