MT#5879 Fix redirect chain and utf8 handling.