var bytes:ByteArray = new ByteArray(); //BOM bytes.writeByte(0xEF); bytes.writeByte(0xBB); bytes.writeByte(0xBF); //data bytes.writeUTFBytes(csv);