Convert OctetString to "human" readable string

I read some table (tableUtils.getTable)

Somme column contains OctetString
with varBinding.getVariable().toString I obtain somethink like
4d:69:63:72:6f:73:6f:66:74:20:49:53:41:54:41:50:20:41:64:61:70:74:65:72:00
Is there a way to convert it to a “human” readable string ?

Hi,

as the last byte (00) of the string is not printable, toString() automatically calls toHexString(). You could use toASCII(char placeholder) function of OcetString class.

Kind regards,
Jochen

1 Like

Ok I see. Thanks a lot !