Added encode_data function

It's arguments are:
data = the data to encode in an array
sepchar = character that seperates the data