Added encoding support.