Revert removing unicode2utf8 and encode staticmethods

[ci skip]