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.