save buffer after replacing non-ascii