This encoder is fully enclosed when fitted, so dirt should never get near the optics, however there's a total lack of pulses from just the A side, so it's not likely to be dirt.

I've had a quote for a new direct replacement encoder, which is actually cheaper than what I thought it would be. I'm just waiting for a proforma so I can pay for it.
When I get time, I'll have a go at dismantling the old encoder to see if there's anything obvious.