make encoding support generic