Windows Vista Forums

Printing Ascii and non-Ascii codes

  1. #1


    IT Staff Guest

    Printing Ascii and non-Ascii codes

    Can powershell list the ascii codes and non-ascii codes ?




      My System SpecsSystem Spec

  2. #2


    Rob Campbell Guest

    RE: Printing Ascii and non-Ascii codes

    Is this what you mean:


    PS E:\> [int][char]"a"
    97
    PS E:\> [char[]]"some text" |% {[int]$_}
    115
    111
    109
    101
    32
    116
    101
    120
    116
    PS E:\>

    Or something else?


    "IT Staff" wrote:

    > Can powershell list the ascii codes and non-ascii codes ?
    >
    >
    >
    > .
    >

      My System SpecsSystem Spec

  3. #3


    Rob Campbell Guest

    RE: Printing Ascii and non-Ascii codes

    Do you mean this:

    PS E:\> [int][char]"a"
    97

    PS E:\> [char[]]"some text" |% {[int]$_}
    115
    111
    109
    101
    32
    116
    101
    120
    116

    or something else?

    "IT Staff" wrote:

    > Can powershell list the ascii codes and non-ascii codes ?
    >
    >
    >
    > .
    >

      My System SpecsSystem Spec

  4. #4


    IT STAFF Guest

    Re: Printing Ascii and non-Ascii codes

    yes

    "Rob Campbell" <RobCampbell@newsgroup> wrote in message
    news11FE85C-F220-4B24-BE6E-9D296EAB1D6A@newsgroup

    > Do you mean this:
    >
    > PS E:\> [int][char]"a"
    > 97
    >
    > PS E:\> [char[]]"some text" |% {[int]$_}
    > 115
    > 111
    > 109
    > 101
    > 32
    > 116
    > 101
    > 120
    > 116
    >
    > or something else?
    >
    > "IT Staff" wrote:
    >

    >> Can powershell list the ascii codes and non-ascii codes ?
    >>
    >>
    >>
    >> .
    >>

      My System SpecsSystem Spec

  5. #5


    IT STAFF Guest

    Re: Printing Ascii and non-Ascii codes

    a-z, A-Z, 0-9, other characters like ~!@#, etc etc, inclusive of blank
    space, is there a way of listing it ?




    "Rob Campbell" <RobCampbell@newsgroup> wrote in message
    news:5CE175ED-D20B-492E-9B37-619C6ED3A1F2@newsgroup

    > Is this what you mean:
    >
    >
    > PS E:\> [int][char]"a"
    > 97
    > PS E:\> [char[]]"some text" |% {[int]$_}
    > 115
    > 111
    > 109
    > 101
    > 32
    > 116
    > 101
    > 120
    > 116
    > PS E:\>
    >
    > Or something else?
    >
    >
    > "IT Staff" wrote:
    >

    >> Can powershell list the ascii codes and non-ascii codes ?
    >>
    >>
    >>
    >> .
    >>

      My System SpecsSystem Spec

  6. #6


    Rob Campbell Guest

    Re: Printing Ascii and non-Ascii codes

    Like this?

    0..255 |% {write-host "$($_) = $([char]$_)"}

    "IT STAFF" wrote:

    > a-z, A-Z, 0-9, other characters like ~!@#, etc etc, inclusive of blank
    > space, is there a way of listing it ?
    >
    >
    >
    >
    > "Rob Campbell" <RobCampbell@newsgroup> wrote in message
    > news:5CE175ED-D20B-492E-9B37-619C6ED3A1F2@newsgroup

    > > Is this what you mean:
    > >
    > >
    > > PS E:\> [int][char]"a"
    > > 97
    > > PS E:\> [char[]]"some text" |% {[int]$_}
    > > 115
    > > 111
    > > 109
    > > 101
    > > 32
    > > 116
    > > 101
    > > 120
    > > 116
    > > PS E:\>
    > >
    > > Or something else?
    > >
    > >
    > > "IT Staff" wrote:
    > >

    > >> Can powershell list the ascii codes and non-ascii codes ?
    > >>
    > >>
    > >>
    > >> .
    > >>
    >
    > .
    >

      My System SpecsSystem Spec

  7. #7


    Rob Campbell Guest

    Re: Printing Ascii and non-Ascii codes

    Sorry for the double reply. I couldn't get anything to update until just a
    few minutes ago, and thought I'd closed the window without hitting Post on
    the first one.

    "IT STAFF" wrote:

    > yes
    >
    > "Rob Campbell" <RobCampbell@newsgroup> wrote in message
    > news11FE85C-F220-4B24-BE6E-9D296EAB1D6A@newsgroup

    > > Do you mean this:
    > >
    > > PS E:\> [int][char]"a"
    > > 97
    > >
    > > PS E:\> [char[]]"some text" |% {[int]$_}
    > > 115
    > > 111
    > > 109
    > > 101
    > > 32
    > > 116
    > > 101
    > > 120
    > > 116
    > >
    > > or something else?
    > >
    > > "IT Staff" wrote:
    > >

    > >> Can powershell list the ascii codes and non-ascii codes ?
    > >>
    > >>
    > >>
    > >> .
    > >>
    >
    > .
    >

      My System SpecsSystem Spec


Printing Ascii and non-Ascii codes
Similar Threads
Thread Forum
Unicode or ASCII PowerShell
Re: ASCII or TBCP Vista print fax & scan
Ascii VB Script
When non-ASCII creeps into script PowerShell
Automatic backticking of ASCII control codes in (registry) path na PowerShell