Use a faster version of ENCODING_SET.

Remove several ifdefs.