characterencodings is only needed if you call one of the character conversion functions; it is a lazy local import inside a template.
Neat! I knew local imports were useful for keeping symbols in a smaller scope, but didn't think about it as a way to control dependencies.