Implement encodeString, decodeString