def string_to_bytes(string, size):
if len(string) > size:<EOL><INDENT>raise PyVLXException("<STR_LIT>")<EOL><DEDENT>encoded = bytes(string, encoding='<STR_LIT:utf-8>')<EOL>return encoded + bytes(size-len(encoded))<EOL>
Convert string to bytes add padding.