* 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.