Menu

Commit [r3092]  Maximize  Restore  History

More unicode fixes for the TracChangeset and TracBrowser modules.

* Perform the diffs in unicode. In changeset.py, we convert
the file content to unicode before the diffs are computed.
Should fix #2905 and #2363.
* Clarified some assumptions made in the mimeview component.
Unless stated otherwise, strings should be unicode strings.
This is particularly true for the `preview_to_hdf` method.
Therefore, in browser.py we have to convert to unicode as well.

Both of the above make use of the following:
* a new `Mimeview.to_unicode` method which uses the standard
Mimeview ways to infer the charset from either the content
type or from the content itself
* the above makes use of a new `to_unicode` function in `trac.util`
which always succeeds at producing an unicode string

I also made clear that when using `trac.util.NaivePopen`,
a properly encoded string must be given. I couldn't fully
test the corresponding changes in enscript.py and php.py, yet.

cboos 2006-04-01

changed /trunk/trac/mimeview/api.py
changed /trunk/trac/mimeview/enscript.py
changed /trunk/trac/mimeview/php.py
changed /trunk/trac/scripts/tests/admin.py
changed /trunk/trac/util/__init__.py
changed /trunk/trac/versioncontrol/web_ui/browser.py
changed /trunk/trac/versioncontrol/web_ui/changeset.py
/trunk/trac/mimeview/api.py Diff Switch to side-by-side view
Loading...
/trunk/trac/mimeview/enscript.py Diff Switch to side-by-side view
Loading...
/trunk/trac/mimeview/php.py Diff Switch to side-by-side view
Loading...
/trunk/trac/scripts/tests/admin.py Diff Switch to side-by-side view
Loading...
/trunk/trac/util/__init__.py Diff Switch to side-by-side view
Loading...
/trunk/trac/versioncontrol/web_ui/browser.py Diff Switch to side-by-side view
Loading...
/trunk/trac/versioncontrol/web_ui/changeset.py Diff Switch to side-by-side view
Loading...
MongoDB Logo MongoDB