Properly encode the nonce in order to avoid modifications by the servlet container.