Added encoding support