fixbug: encodeString length