git-{browser,diff}.cgi: properly decode non-UTF-8
The `utf8::valid` function returns true if the internal UTF-8
bit is set OR the string is held as raw bytes.
That's not the correct test to use. As a result, strings
that were not in UTF-8 format were being returned as-is (i.e.
raw bytes in a non-UTF-8 format) because the `utf8::valid`
would return true (they were held as raw bytes) but then
the `utf8::decode` would fail (leaving them unchanged).
Instead, check the internal flag (`Encode::is_utf8`) and if
it *IS* set _OR_ the string can be decoded by `utf8::decode`
then return the now-decoded-into-internal-utf8-format string.
If that fails go ahead and stuff it through the fallback
decoding and return that. And make sure the fallback_encoding
initialization does not get stepped on by removing the bogus
assignment in the `my` declaration that takes place _after_
the BEGIN block that does the initialization.
This is how it was meant to work all along.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>