cleanup: Removed some unused variables.
support alternate encodings for unicode utility funcs.
Prefer utf-8 for strings that aren't specifically for filepaths.