Handle LookupErrors in repository encoding along with UnicodeError.

If the encoding field for a repository has garbage entries, or a system is
missing the locale information, trying to decode given a specific encoding
might fail with LookupError. In this case, we want to just continue through
with the rest of the logic.

Testing done: Ran unit tests.

Fixes bug 3399.
Merge branch 'release-2.0.x'
Allow sending a test e-mail from the e-mail settings form.

When changing the server settings for how to send e-mail, it's nice to give
people the option to test it (so they don't have to create a fake review
request and jump through a bunch of hoops). This change adds a new check-box
that allows users to trigger such an email after the form is saved.

This doesn't cover 100% of the things that can go wrong with sending e-mails
(such as random SPF/DKIM failures or mail servers that don't like the
Sender/From distinction), but it should be good enough to verify that you typed
your SMTP credentials correctly.

This also organizes the e-mail settings into three sections.

Testing done:
Set my e-mail backend to console and saved the form with this check-box set.
Saw that it "sent" an e-mail from the correct Sender (noreply) to my user's
configured e-mail address.

Fixes bug 2073.

Reviewed at https://reviews.reviewboard.org/r/5952/
Fix handling of string types for perforce changeset descriptions.

We get data out of p4python as `str`s, but we weren't treating them as such.
This change adds some logic to decode changesets before processing them, which
should improve the situation.

Testing done: Ran unit tests.

Fixes bug 3407.

Reviewed at https://reviews.reviewboard.org/r/5953/
Merge branch 'release-2.0.x'