Skip to content

Default character encoding can result in unreadable logs. #44

@RedGreenBlue09

Description

@RedGreenBlue09

Currently, Installer uses the default system codepage. This is not a problem for CMD, as the output redirection doesn't take into account the encoding (it just writes raw bytes). However, Powershell is a different story as it usually does some processing on the I/O which alters the raw data.

This can be tested by creating Unicode.txt containing some Unicode characters, then cat Unicode.txt > Unicode2.txt. Seems like Unicode2.txt is UTF-16 LE BOM, but the Unicode characters are broken.

Solution: Set Powershell encoding to UTF8 by changing $PSDefaultParameterValues and $OutputEncoding. This solves output redirection from Powershell, but the output passed to CMD.exe is still changed, so %Logger% will not output correctly.
There are 2 potential ways to fix this:

  • Use chcp 65001 but this changes the perfectly compatible font to raster font when Powershell is launched. There is no known way to work around this bug.
  • Create another logger for Powershell which uses Powershell's output redirection. However, this creates a file with 2 encodings (Default OEM codepage & UTF-8).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions