Printing Ascii and non-Ascii codes

  • Follow


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



0
Reply IT 1/5/2010 10:06:00 AM

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 ?
> 
> 
> 
> .
> 
0
Reply Utf 1/5/2010 12:05:01 PM


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 ?
> 
> 
> 
> .
> 
0
Reply Utf 1/5/2010 12:47:01 PM

yes

"Rob Campbell" <RobCampbell@discussions.microsoft.com> wrote in message 
news:D11FE85C-F220-4B24-BE6E-9D296EAB1D6A@microsoft.com...
> 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 ?
>>
>>
>>
>> .
>> 

0
Reply IT 1/5/2010 2:14:28 PM

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@discussions.microsoft.com> wrote in message 
news:5CE175ED-D20B-492E-9B37-619C6ED3A1F2@microsoft.com...
> 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 ?
>>
>>
>>
>> .
>> 

0
Reply IT 1/5/2010 2:16:07 PM

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@discussions.microsoft.com> wrote in message 
> news:5CE175ED-D20B-492E-9B37-619C6ED3A1F2@microsoft.com...
> > 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 ?
> >>
> >>
> >>
> >> .
> >> 
> 
> .
> 
0
Reply Utf 1/5/2010 10:53:01 PM

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@discussions.microsoft.com> wrote in message 
> news:D11FE85C-F220-4B24-BE6E-9D296EAB1D6A@microsoft.com...
> > 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 ?
> >>
> >>
> >>
> >> .
> >> 
> 
> .
> 
0
Reply Utf 1/5/2010 10:55:01 PM

6 Replies
1451 Views

(page loaded in 0.13 seconds)

Similiar Articles:
















7/26/2012 4:14:33 AM


Reply: