encode string as ascii for ctypes