From 052e66e504aa80f2d885ee89d61a613d447b6b5f Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Sun, 18 Nov 2018 12:30:01 +0100 Subject: [PATCH] windows: garbled output because of codepage --- CHANGELOG.md | 1 + lib/util.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0550e8b..9401dc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,6 +100,7 @@ Other changes | Version | Date | Comment | | -------------- | -------------- | -------- | +| 3.48.4 | 2018-11-18 | windows: garbled output because of codepage | | 3.48.3 | 2018-11-18 | `dockerContainerStats()` fixed issue `cpu_percent` win | | 3.48.2 | 2018-11-18 | `dockerContainerStats()` fixed issue `cpu_percent`, win exec | | 3.48.1 | 2018-11-17 | `docker...()` fixed issue parsing docker socket JSON | diff --git a/lib/util.js b/lib/util.js index 8483b9c..0dcea8a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -203,8 +203,8 @@ function execWin(cmd, opts, callback) { callback = opts; opts = execOptsWin; } - newCmd = 'chcp 65001 > nul && cmd /C ' + cmd + ' && chcp ' + codepageWin + ' > nul'; - exec(newCmd, util.execOptsWin, function (error, stdout) { + let newCmd = 'chcp 65001 > nul && cmd /C ' + cmd + ' && chcp ' + codepageWin + ' > nul'; + exec(newCmd, execOptsWin, function (error, stdout) { callback(error, stdout) }) }