Finish porting Facet.Encoding