Fix crash when users have non-ascii chars in names

Review Request #2657 — Created Oct. 14, 2011 and submitted — Latest diff uploaded

Information

Review Board

Reviewers

Fix crash when users have non-ascii chars in names

The HTTP headers are not allowed to contain other than US-ASCII characters,
so if users have names containing non-ascii characters their infobox would
not be shown, since django's http.HttpResponse._convert_to_ascii function
throws a UnicodeError if value.encode('us-ascii') fails.
Manually tested by creating a user "asdf" with last name "Näsman", which made /users/asdf/infobox crash, until I applied this patch after which the page showed up correctly.