mozilla/kuma — pull request #2296 by ubernostrum (2014-04-15 17:16:58+00:00)
Title: Work around a character-encoding issue in search.

The problem here is that non-ASCII referers will sometimes behave
properly but sometimes not. Properly fixing this would likely be more
effort than it's worth, as it would involve cleaning up things like
borked "Ã±" sequences in referers.

So this simply slaps a small band-aid on the problem: when URLObject
throws a UnicodeDecodeError, we bail out rather than trying to undo
whatever sequence of multiply-encoded byte mangling turned the referer
into the monster that it is.