Fix #19980: Signer broken for binary keys (with non-ASCII chars)

See https://code.djangoproject.com/ticket/19980.