[Zope] Structured text / charsets

Oliver Sturm sturm at oliver-sturm.de
Sat Feb 19 09:57:40 EST 2005


Dieter Maurer wrote:

>
>You have a chance that StructuredText might work with Unicode
>correctly -- independent of locale (I am not sure, though;
>the chance comes from the fact that StructuredText uses
>regular expressions and they can handle unicode correctly (and
>usually transparently).
>  
>

Thanks, I tried that. It didn't change anything, though. I've looked at 
the source code and I found that the problem lies in the Python 
string.letters expression, which is used to build the regular 
expressions for the Structured Text implementation.

Actually, I've been able to make modifications to the file 
DocumentClass.py that make things work for me. I've really simplified 
the expressions a bit, so I guess there may be other problems with that 
approach. For example, the original expression for the bold format was 
constructed like this:

r'\*\*([%s%s%s\s]+?)\*\*' % (letters, digits, strongem_punc)


I changed this to say:

r'\*\*([^*]+)\*\*'


Obviously, this may introduce its own problems, but then I can easily 
explain to my users that they can't format a string bold that contains a 
* character. Probably depending a little on the content that's supposed 
to be entered :-)

               Oliver Sturm
-- 
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de 
ICQ 27142619 http://www.sturmnet.org/blog

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050219/f40763af/attachment.htm


More information about the Zope mailing list