-added encodeString()