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
If you want the output of a PowerShell command to be produced in ASCII encoding from a simple output redirection operator like >, you can use an...
PowerShell
How to tell SED to emit output in 8-bit ASCII only?
I am sure there are better places/forums to ask the below question, but I didn't find any. If you know a better place please advise! I have to...
Vista file management
Re: ASCII or TBCP
That's just a complain to Apple .... doesn't give me any background on the protocols .... Trust me I do my homework before I come here .... ...
Vista print fax & scan
Ascii
Can someone please help me translate the following vb.net function to vbscript? Code:Public Shared Function EncGuid(ByVal expression As...
VB Script
ASCII characters in Reply messages
In the last week, I have received replies from people to whom I have sent emails. Under their replies is my original message. In my original and...
Vista mail
When non-ASCII creeps into script
What to do, what to do... When non-ASCII characters creep into a script, what's the best way to see them and remove them? Without re-typing the...
PowerShell
Automatic backticking of ASCII control codes in (registry) path na
Apparently, the Windows Registry is not very strict in respect of allowed characters in keys and property names. So when I do a get-childitem in: ...
PowerShell