Re: Any clever ways to convert octet strings to ASCII?

Thorsten Geelhaar (tgeelhaa@funghi.Materna.DE)
Fri, 11 Apr 1997 08:41:35 +0200

Hi,
> I'm using Scotty and doing gets and getnexts just fine, but I'd
> like to convert the octet strings from their hex format into
> regular ASCII before displaying them. Before I write a routine
> to do so (given that my style of coding is "college dormitory furniture" -
> ugly, kludgy, and semi-functional), I thought I'd ask to see if anyone
> has come up with a good way of doing this. Thanks much.
>
> ----
> John Switzer | jrs@net.com
> --
> !! This message is brought to you via the `tkined & scotty' mailing list.
> !! Please do not reply to this message to unsubscribe. To subscribe or
> !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
> !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.

set octet "48:49"
set ascii [mib format .1.3.6.1.2.1.1.1 $octet]
puts $ascii -> hi

You can do it with any MIB_Oid which is a Displaystring

cu
Thorsten

-----------------------------------------------------------------
Thorsten Geelhaar Telefon: +49 231 5599 399 |\/\/\/|
Dr. Materna GmbH Fax : +49 231 5599 100 | |
| |
Vosskuhle 37 e-mail : Thorsten.Geelhaar@materna.de | (o)(o)
C _)
D-44141 Dortmund GERMANY | ,___|
| /
"We're all mad here. I'm mad, You're mad." /____: "How do you know
I'm mad?" said Alice.
"You must be" said the Cat, "or you wouldn't have come here."

------------------------------------------------------------------

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.