Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing Ascii and non-Ascii codes

7 views
Skip to first unread message

IT Staff

unread,
Jan 5, 2010, 5:06:00 AM1/5/10
to
Can powershell list the ascii codes and non-ascii codes ?

Rob Campbell

unread,
Jan 5, 2010, 7:05:01 AM1/5/10
to
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 ?
>
>
>

> .
>

Rob Campbell

unread,
Jan 5, 2010, 7:47:01 AM1/5/10
to
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 ?
>
>
>

> .
>

IT STAFF

unread,
Jan 5, 2010, 9:14:28 AM1/5/10
to
yes

"Rob Campbell" <RobCa...@discussions.microsoft.com> wrote in message
news:D11FE85C-F220-4B24...@microsoft.com...

IT STAFF

unread,
Jan 5, 2010, 9:16:07 AM1/5/10
to
a-z, A-Z, 0-9, other characters like ~!@#, etc etc, inclusive of blank
space, is there a way of listing it ?


"Rob Campbell" <RobCa...@discussions.microsoft.com> wrote in message

news:5CE175ED-D20B-492E...@microsoft.com...

Rob Campbell

unread,
Jan 5, 2010, 5:53:01 PM1/5/10
to
Like this?

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

"IT STAFF" wrote:

> .
>

Rob Campbell

unread,
Jan 5, 2010, 5:55:01 PM1/5/10
to
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:

> .
>

0 new messages