Error when logging request data in unexpected encoding

the logger fails if PATH_INFO is in an unexpected encoding. If the error is then caught by an generic error view, that means nothing gets logged.

Attached is a patch with tests which resolves. The patch is pretty ugly, but should do the job. Improvements appreciated.