A lot of laptops will output optical through the headphone jack, There is an adapter thats looks like a headphone plug but has an optical cable plug on the other side. Also some laptops can use a Mono 1/8in phono to RCA adapter to a regular coaxial cable.
What model is your laptop. My asus is hoked up right now with the headphone to optical plug. You normally haft to enable it through the sound properties.
Perhaps a little clarification is needed. *Some* headphone jacks double up as digital optical jacks simultaneously, by incorporating an optical transmitter in the jack. Also, some USB->SPDIF convertors send optical output via the headphone jack.
The OP was asking if instead of sending an analog signal via the headphone jack, software converts the signal to SPDIF spec, and sends it to the same jack. SPDIF (digital) signals are way too high frequency to be output by the headphone circuit, so the answer is no.