Ticket #3261: mimeview-php-unicode-stream.diff
| File mimeview-php-unicode-stream.diff, 1.0 KB (added by Tim Hatch <trac@…>, 6 years ago) |
|---|
-
trac/mimeview/php.py
18 18 19 19 from trac.core import * 20 20 from trac.config import Option 21 from trac.mimeview.api import IHTMLPreviewRenderer 21 from trac.mimeview.api import IHTMLPreviewRenderer, content_to_unicode 22 22 from trac.util import NaivePopen 23 23 from trac.util.markup import Deuglifier 24 24 … … 63 63 # -n to ignore php.ini so we're using default colors 64 64 cmdline += ' -sn' 65 65 self.env.log.debug("PHP command line: %s" % cmdline) 66 67 np = NaivePopen(cmdline, content.encode('utf-8'), capturestderr=1) 66 67 content = content_to_unicode(self.env, content, mimetype) 68 content = content.encode('utf-8') 69 np = NaivePopen(cmdline, content, capturestderr=1) 68 70 if np.errorlevel or np.err: 69 71 err = 'Running (%s) failed: %s, %s.' % (cmdline, np.errorlevel, 70 72 np.err)
