Replace util.py functions to and from unicode with direct calls to .encode and .decode, as it did not save much code, means the "strict"/"ignore"/"replace" decision can be made per call. Also helps narrow down on why sys.getfilesystemencoding() is not working as expected in some places.