[Zope] how to display hex data ?

Dieter Maurer dieter@handshake.de
Fri, 6 Apr 2001 22:27:56 +0200 (CEST)


Jose Soares writes:
 >       OID        DISTRETTO
 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=
=3D=3D
 > a200000002000100 I10500
 >=20
 > but Zope display it as:
 >=20
 > OID      DISTRETTO
 > -------------------------
 > =A2=02=01     I10500

Apparently, your database does not send the OID as a hexadecimal
string but as a binary string.

You could convert the binary string into a hexadecimal string
in an External Method:

   from string import join

   def convertBinaryToHexString(binstring):
       return join(map(lambda c: '%x' % ord(c), binstring), '')


Dieter