[stringtemplate-interest] [patch] Unicode: One more hack

Roman Odaisky roma at qwertty.com
Sun Aug 10 07:52:26 PDT 2008


Greetings,

> Attached patch is all one seemingly needs to use UTF-8 template files.

That works for $x$², but not for $x:{$it$²}$.

I had to replace all mentions of __str__ and str() by __unicode__ and 
unicode(), that did the job.

I did it by two simple commands:
sed -i -e 's/\<__str__\>/__unicode__/g' ./**/*.py
sed -i -e 's/\<str[(]/unicode(/g' ./**/*.py

I also attach the result as a patch.

Of course, all of this is one big hack, the person responsible for PyST should 
upgrade it for Unicode in a more sensible manner.

-- 
HTH
Roman.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: st.str2unicode.diff
Type: text/x-diff
Size: 27284 bytes
Desc: Patch for adding Unicode support to ST
Url : http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20080810/4e6ce383/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2286 bytes
Desc: not available
Url : http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20080810/4e6ce383/attachment-0003.bin 


More information about the stringtemplate-interest mailing list