array with hebrew chars

Welcome Forums General PowerShell Q&A array with hebrew chars

This topic contains 3 replies, has 4 voices, and was last updated by

5 years, 3 months ago.

  • Author
  • #11225

    Points: 0
    Rank: Member

    the array like this :


    for ($i=0; $i -lt $arrOrganizations.length; $i++) {

    the result is :





    instead of



    only after setting setting the regional setting->administrative -> change system local to Hebrew(Israel)

    i get the correct result, what can cause it?

  • #11279

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    The array is likely storing the characters individually rather than as pairs. Unfortunately, I don't have access to a Hebrew-language system, so I can't test this and confirm.

  • #11290

    Points: 0
    Rank: Member

    Are you seeing this problem in the ISE, or only at the PowerShell console? The console subsystem is a pain for this kind of thing; it has no Unicode support and very limited font selection. It sounds like you have the font covered, so you might be able to get away with adding this line at the beginning of your code:

    [Console]::OutputEncoding = [Text.Encoding]::GetEncoding(1255)

    Unfortunately, I don't have a font that displays those characters properly, so I can't really test it.

  • #11353

    Points: 1
    Rank: Member

    On a Win7 system running PS2 with Hebrew installed, but Non-Unicode set to English US:


    `PS C:\> $arrOrganizations=("??","??");
    PS C:\> for ($i=0; $i -lt $arrOrganizations.length; $i++) {$arrOrganizations[$i]}


    `PS C:\> $arrOrganizations=("א×'","×'ד")
    for ($i=0; $i -lt $arrOrganizations.length; $i++) {$arrOrganizations[$i]}

    Can you tell us what you're running on/with?

The topic ‘array with hebrew chars’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort