On 7/22/2011 4:48 PM, Remy Blank wrote:
Remy Blank wrote:
How is trac.dist.extract_javascript_script? I can't find a reference to
that anywhere in the code, and that's where the encoding option is missing.
Ok, got it. The following patch fixes the issue:
;-)
Index: trac/dist.py
===================================================================
--- trac/dist.py (revision 10762)
+++ trac/dist.py (working copy)
@@ -219,7 +219,8 @@
out = StringIO()
stream = Stream(XMLParser(fileobj))
- stream.select('//script[@type="text/javascript"]').render(out=out)
+ stream = stream.select('//script[@type="text/javascript"]')
+ stream.render(out=out, encoding='utf-8')
out.seek(0)
return extract_javascript(out, keywords, comment_tags, options)
Well, your patch is more compact, but mine better shows that this is a
kludge needed to workaround a problem in Babel... ideally we should just
be able to stay in unicode all the way long.
I'm wondering if there are other calls to `render()` where the encoding
needs to be stated explicitly.
Well, usually getting an `unicode` object should be just fine.
-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to trac-dev@googlegroups.com.
To unsubscribe from this group, send email to
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en.