Remove encoding.hpp to remove redundant dependencies

and fix for utf8 related functions.