added incoming encoding support