utf-8 characters in powershell log
cmd.exe's log displays them fine, but powershell does not.
Compare the two in this log:
https://ci.appveyor.com/project/stevenvachon/nopter/build/job/qk06x...
The first is powershell and the checkmark character
(√
) is displayed as
√
.
This is a minor issue in my case, but it may not be so for others. Perhaps it is my fault for not configuring properly?: https://github.com/stevenvachon/nopter/blob/master/appveyor.yml
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 21 Nov, 2014 04:34 AM
I'm afraid this is PowerShell issue.
From what I've found there is no way to set encoding for process output redirection:
https://connect.microsoft.com/PowerShell/feedback/details/738558/se...
http://stackoverflow.com/questions/22349139/utf8-output-from-powers...
2 Posted by Cameron Taggart on 15 Apr, 2015 03:41 AM
The characters that are showing up appear to be UTF8 bytes encoded using CodePage 437. Specifically the example listed in http://www.appveyor.com/docs/lang/nodejs-iojs can be reproduced with this F#:
let s = "├──"
let utf8 = System.Text.Encoding.UTF8
let ibm437 = System.Text.Encoding.GetEncoding 437
printfn "%s" (utf8.GetBytes s |> ibm437.GetString)
Not surprising, that is the default Console.OutputEncoding in PowerShell.
For completeness, the other code pages that matched the error text were 861 and 865, but I bet it is probably 437.
If you want to email me how you are launching PowerShell, I can try out fixes for it. I just need a locally reproducible test case.
Support Staff 3 Posted by Feodor Fitsner on 15 Apr, 2015 04:33 AM
Sure, AppVeyor implements custom PowerShell host with UI, something like that:
https://msdn.microsoft.com/en-us/library/ee706570(v=vs.85).aspx
However, there is a trick when running some external process in that sample - if the process has a handle to the console all output will be redirected right to the console and won't be caught by
Write
methods. Use Windows forms or WPF app to host your custom PS host to suppress console output.If you can solve that puzzle that would be awesome! :)
4 Posted by Cameron Taggart on 15 Apr, 2015 06:11 PM
I put that code in a solution that builds here:
https://github.com/ctaggart/AppVeyor
The next steps are to reproduce the issue locally. Help with that in the form of a pull request would be very welcome. I will also try again when I get through a few other higher priority issues. :)
Support Staff 5 Posted by Feodor Fitsner on 15 Apr, 2015 06:22 PM
yeah, the host should be not a console app, but windows forms or WPF.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:55 AM.