Re: hex to ebcdic
- From: "Dr.Ruud" <rvtol+news@xxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 02:19:16 +0200
Gunnar Hjalmarsson schreef:
roch77:
I have a string of hex that represent ebcdic characters. Is there a
way that I can do the following in perl.
hex string = "f1f2d7d9f0"
the result I want = "12PR0"
From looking up a ascii/hex/ebcdic table, I was able to arrive atresult. ie: f1 => 1, f2 => 2, d7 =>P etc..
the
Is there a perl function that will do this?
There is a module.
use Convert::EBCDIC 'ebcdic2ascii';
$hex = 'f1f2d7d9f0';
( $ebcdic = $hex ) =~ s/(..)/chr(hex $1)/eg;
$ascii = ebcdic2ascii( $ebcdic );
See also Encode.
--
Affijn, Ruud
"Gewoon is een tijger."
.
- Follow-Ups:
- Re: hex to ebcdic
- From: Gunnar Hjalmarsson
- Re: hex to ebcdic
- References:
- hex to ebcdic
- From: roch77
- Re: hex to ebcdic
- From: Gunnar Hjalmarsson
- hex to ebcdic
- Prev by Date: Re: Assigning another filehandle to STDOUT, using binmode.
- Next by Date: FAQ 3.13 How can I use curses with Perl?
- Previous by thread: Re: hex to ebcdic
- Next by thread: Re: hex to ebcdic
- Index(es):
Relevant Pages
|
|