Thomas G. Apostolou schrieb:
Αρχικό μήνυμα από  Tino Wildenhain <[EMAIL PROTECTED]>:

Thomas G. Apostolou schrieb:

I have an External Method "CharSetConv" that get a
String_To_Be_Converted, its encoding and the encoding to convert



I call it like this:
<dtml-in sequence-item>
       <td><dtml-var expr="CharSetConv(_,


'ISO-8859-7', 'UTF-8')"> </td>
but in the place of 'String_To_Be_Converted' i want to pass


sequence-item>, and i can not find the way to do so.
i have tried to write it like:
<dtml-in sequence-item>
       <td><dtml-var expr="CharSetConv(_, '<dtml-var


'ISO-8859-7', 'UTF-8')"> </td>
but does not work
Can anyone help please?

Well, DTML sux for a reason ;)

but <dtml-in sequence-item> makes no sense unless you have list in

You dont need an external method to convert between charsets:

   expr="_['sequence-item'].decode('iso-8859-7').encode('utf-8')" >


Dear friend thanks alot fro your reply.
I do have a lists in list
your sugestion return an error

Site error This site encountered an error trying to fulfill your
request. The errors were: Error Type AttributeError Error Value 'NoneType' object has no attribute 'decode' Request made at 2005/10/19 17:17:03.485 GMT+3
what is wrong?

Looks like you have a None object among your strings in the list.
If so, you can either do:

<dtml-if sequence-item> <dtml-var> expr="_['sequence-item'].decode('iso-8859-7').encode('utf-8')" >

which is the quick & dirty variant, or:
<dtml-var expr="(_['sequence-item'] or "").decode('iso-8859-7').encode('utf-8')" >

Which uses a "boolean trick".


PS: get used to python scripts where this is a lot better
to write

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to