[ZCM] [ZC] 1762/ 7 Comment "Restructured Text unicode problem"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Thu May 5 13:23:08 EDT 2005


Issue #1762 Update (Comment) "Restructured Text unicode problem"
 Status Rejected, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1762

==============================================================
= Comment - Entry #7 by garanin on May 5, 2005 1:23 pm

I not agree.
1) <dtml-var zzz> => print source of zzz 
2) <dtml-var zzz fmt="restructured-text"> => work for zzz with ascii content




________________________________________
= Reject - Entry #6 by ajung on May 5, 2005 6:14 am

 Status: Accepted => Rejected

<dtml-var zzz fmt="restructured-text">

This makes absolutely no sense if zzz is *already* an instance
of RestructuredDocument. 

<dtml-var zzz> is in this case sufficient since 'zzz' 
*automatically* renders the reST content as HTML and there is no need to transform the HTML against through reST.

________________________________________
= Comment - Entry #5 by garanin on May 4, 2005 1:50 pm

Sorry, i mistake in previous message. 
I have not problem with ZReST, i have problem with restructured_text function for unicode text:
1) add ReStructureText Document from ZMI with id == zzz 
2) set input\output encoding = utf-8
3) edit new document: i write russian text UTF-8 (ура)
4) save document & view => OK 
5) now, i want use ReST inside dtml accord doc/RESTRUCTUREDSTEXT.txt
6) create dtml-method with content: <dtml-var zzz fmt="restructured-text">  and save
7) view dtml-method => UnicodeEncodeError 

(sorry, i dont know how get *full traceback*)



________________________________________
= Assign - Entry #4 by ajung on May 3, 2005 1:01 am

 Status: Pending => Accepted

 Supporters added: ajung

RestructuredText documents have dedicated properties for input and output-encoding
which must be set properly. Please verify if this is the case for you.
And please provide a **full traceback** if you want to have this fixed.
________________________________________
= Comment - Entry #3 by garanin on Apr 29, 2005 5:27 pm

Details:
1) add ReStructureText Document from ZMI 
2) edit new document: i write russian text UTF-8 (ура)
3) try save document => Error Type: UnicodeEncodeError
Error Value: 'ascii' codec can't encode characters in position 507-509: ordinal not in range(128)




________________________________________
= Comment - Entry #2 by ajung on Apr 29, 2005 6:05 am

Please describe how to provoke a Unicode error.
________________________________________
= Request - Entry #1 by garanin on Apr 22, 2005 5:58 pm

DocumentTemplate/DT_Var/restructured_text not work with unicode :

def restructured_text(v, name='(Unknown name)', md={}):

    from reStructuredText import HTML

    if isinstance(v,StringType): txt = v
    elif aq_base(v).meta_type in ['DTML Document','DTML Method']:
        txt = aq_base(v).read_raw()
    else: txt = str(v) <========================== error for UnicodeType

    return HTML(txt)



==============================================================



More information about the Zope-Collector-Monitor mailing list