Encoding problems with umlauts in logged exception messages #3284
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
I have the following simple script:
"use strict";
console.log("üÜäÄöÖß")
console.error("üÜäÄöÖß");
throw new Error("üÜäÄöÖß"); // or alternatively:
console.assert(false, "üÜäÄöÖß"); // throws AssertionErrorwhich when executed logs the following:
üÜäÄöÖß
üÜäÄöÖß
c:\Users\….js:4
throw new Error("├╝├£├ñ├ä├Â├û├ƒ");
^
Error: ├╝├£├ñ├ä├Â├û├ƒ
at Object.<anonymous> (c:\Users\….js:4:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
It seems the global exception handler does not use the appropriate output encoding, while console does.
It doesn't seem to make any difference whether I encode my script as UTF8 or anything else - the first two logs are fine, but the error message is not.
Admittedly, I'm still on node v0.10.30. Would an update help?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Activity
silverwind commentedon Oct 8, 2015
Confirming on Windows 7. Setting cmd to unicode with
chcp 65001seems to fix it. Still a bug imho, asconsoledoes it right.mscdex commentedon Oct 8, 2015
It should be noted it displays as expected in the REPL at least.
silverwind commentedon Oct 8, 2015
I assume REPL goes through libuv, while errors such as above are printed directly from C++.
mscdex commentedon Oct 8, 2015
I have a fix coming soon...
silverwind commentedon Oct 8, 2015
Ack!
src: fix exception message encoding on Windows
src: fix exception message encoding on Windows
src: fix exception message encoding on Windows