Displaying special characters in PowerShell

Welcome Forums General PowerShell Q&A Displaying special characters in PowerShell

This topic contains 5 replies, has 2 voices, and was last updated by

 
Keymaster
3 years, 3 months ago.

  • Author
    Posts
  • #27757

    Participant
    Points: 0
    Rank: Member

    I have tried setting different fonts and code pages in PowerShell but I cannot get the following characters to display.

    $bars = [Char[]] '_', '▂', '▃', '▄' ,'▅', '▆', '▇','█'

    The characers belong to the MS Gothic font set but setting PowerShell to use this (rather ugly) font still did not render correctly and instead displayed small hollow squares.

    Any help would be appreciated 🙂

  • #27758

    Keymaster
    Points: 1,524
    Helping HandTeam Member
    Rank: Community Hero

    The PowerShell console can't display extended characters from double-byte character sets. The console app dates from the mid-80s.

  • #27789

    Participant
    Points: 0
    Rank: Member

    That's a shame. I didn't know PowerShell was developed in the 80's.

    Why is it that Bash (a much older technology) can do this? https://github.com/holman/spark

  • #27791

    Keymaster
    Points: 1,524
    Helping HandTeam Member
    Rank: Community Hero

    Ugh. What did I write? The console host was written then, which is why the PowerShell team wrote the ISE for v2. If you can't contribute positively to the conversation, at least don't troll.

  • #27799

    Participant
    Points: 0
    Rank: Member

    I'm not trolling, just a bit of sarcasm.

    You should modify the rules of engagement to include "NO SARCASM".

  • #27803

    Keymaster
    Points: 1,524
    Helping HandTeam Member
    Rank: Community Hero

    Roger.

The topic ‘Displaying special characters in PowerShell’ is closed to new replies.