Encode string (ascii mode) to binary mode