Encoding class
Convert code to use the new Encoding class