• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Printing Ascii and non-Ascii codes

R

Rob Campbell

#2
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 ?
>
>
>
> .
>
 
R

Rob Campbell

#3
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 ?
>
>
>
> .
>
 
I

IT STAFF

#4
yes

"Rob Campbell" <RobCampbell@newsgroup> wrote in message
news:D11FE85C-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 ?
>>
>>
>>
>> .
>>
 
I

IT STAFF

#5
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 ?
>>
>>
>>
>> .
>>
 
R

Rob Campbell

#6
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 ?
> >>
> >>
> >>
> >> .
> >>
>
> .
>
 
R

Rob Campbell

#7
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
> news:D11FE85C-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 ?
> >>
> >>
> >>
> >> .
> >>
>
> .
>