convert string to buffer