Canonicalize encoding shorthand j->json, h->hex before testing against {allow,disallow}_encodings