Fix parameters in encodeString and fix encoding name