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

-utf8 option does not work #262

Closed
espresso3389 opened this issue Apr 29, 2022 · 1 comment · Fixed by #263
Closed

-utf8 option does not work #262

espresso3389 opened this issue Apr 29, 2022 · 1 comment · Fixed by #263

Comments

@espresso3389
Copy link

With vswhere 3.0.1+e2e4e03c65 bundled with VS2022 17.1.6, -utf8 option does not work correctly; even with the option, the command seems to run with the machine's locale. The code described here throws exception during parsing the output:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at C:\Work\decode_test\test.js:3:24
    at exithandler (node:child_process:395:5)
    at ChildProcess.errorhandler (node:child_process:407:5)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v18.0.0
@heaths
Copy link
Member

heaths commented Apr 29, 2022

Thanks for reporting this. I was able to reproduce an issue - though not an exception from JSON.parse() on Node 16 - with vswhere 3.0.1 unless I change the console codepage to 65001, which shouldn't be necessary with this code snippet. With default US codepage 437 using vswhere 2.7.1 I do not see the replacement characters.

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