Better handle whitespace in the repository encodings field.

The encodings field doesn't handle quirky data very well. This change strips
each item in the list of whitespace, and filters for non-empty values.

Testing done: Ran unit tests.

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