Optimized to_utf16.
Optimized from_utf16
More optimizations for listdir.