Skip to content

Encoding problems with umlauts in logged exception messages #3284

Description

@bergus

I have the following simple script:

"use strict";
console.log("üÜäÄöÖß")
console.error("üÜäÄöÖß");
throw new Error("üÜäÄöÖß"); // or alternatively:
console.assert(false, "üÜäÄöÖß"); // throws AssertionError

which 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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions