Determine format based on first character if reading from the socket