Bug 989576 - Restore removed code doing percent-encode for non-ASCII bytes. r=michal.novotny