Fix bug in padding unicode, #17105.

Do you have a recommendation as to how to test that? There isn't a trait for which # will print unicode, so I'd have to have access to the internal function to test it, which isn't possible from here, I don't think.