Added a test to show how multibyte handling in RedirectResponse causes an error
Try to detect and keep the encoding used for the URL

Not ready for merge as I am unsure whether the URL passed into the RedirectResponse should already be URL-encoded or not. (If it should be, we might need to fix the matcher as well for GH #7411.)
Check if mb_detect_encoding is available