google implementation of conversion from string to arraybuffer