[Zope] how to decode base64 in DTML?

Jaroslav Lukesh lukesh at seznam.cz
Thu May 4 14:42:08 EDT 2006


Hi all,

Would you like to help me with decoding base64 string, please?

I was try many ways (*), but no with success, but 

import cStringIO
import mimetools
import binascii
binascii.a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')

in commandline python works OK.

(*)here are some examples:

<dtml-var "_.base64.decode('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_base64.decode('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "base64.decode('YWxla2liYW5nb0B6dWcuY3o=\n')">

<dtml-var "'YWxla2liYW5nb0B6dWcuY3o=\n'.base64.decode()">

<dtml-var "mimetools.base64.decode('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_mimetools.base64.decode('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_.mimetools.base64.decode('YWxla2liYW5nb0B6dWcuY3o=\n')">

<dtml-var "_.base64.decodestring('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "mimetools.base64.decodestring('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_mimetools.base64.decodestring('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_.mimetools.base64.decodestring('YWxla2liYW5nb0B6dWcuY3o=\n')">


<dtml-var "_.binascii.a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_binascii.a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "binascii.a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_.a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "_a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "a2b_base64('YWxla2liYW5nb0B6dWcuY3o=\n')">
<dtml-var "'YWxla2liYW5nb0B6dWcuY3o=\n'.binascii.a2b_base64()">
<dtml-var "'YWxla2liYW5nb0B6dWcuY3o=\n'.a2b_base64()">
<dtml-var "_.binascii('YWxla2liYW5nb0B6dWcuY3o=\n').a2b_base64()">
<dtml-var "_binascii('YWxla2liYW5nb0B6dWcuY3o=\n').a2b_base64()">
<dtml-var "binascii('YWxla2liYW5nb0B6dWcuY3o=\n').a2b_base64()">

Many thanks for your help,

JL.



More information about the Zope mailing list