This is especially true when the content may come from a plugin,
e.g. the fix in the `WikiProcessor` will likely fix #3024.
`to_unicode` will always succeed at producing some unicode object,
whereas the basic `unicode(x)` call can raise an `UnicodeDecodeError`
when given an arbitrarily encoded string.
Thus, `unicode(x)` should only be used when we're confident that `x`
is already an `unicode` or derived object, like `Markup`, or is some other type that can be safely converted to `unicode`.
This also fixes the problems that happened in TracAdmin
when `sys.stdin.encoding` was `None` (#3018).
''Last minute, the typo introduced in r3138 in `format_datetime` is fixed,
and mgood actually already fixed #3018 in r3140 :)''