I'd say it looks like 6 PPR, 24-position, ¼-cycle per detent contacting encoder. (Any two of these is sufficient; typically they're described as 24-position, 6-pulses-per-revolution contacting encoders.)
Good news is these are easily available. Bad news is that I can't find an exact drop-in replacement. The closest thing I can find is the Bourns
ECW series, say ECW0J-J24-BC0006L, ECW0J-B24-AC0006L, ECW0J-B24-BC0006L, or ECW0J-B24-HC0006L. At least
TME has some in stock. Note that these are slightly larger than the Diehl encoder; see the PDF for the exact measurements.
The most problematic thing is the feet pattern and the asymmetric positioning of the pins. To solve that, you could make a precise drawing (we're talking 0.1mm resolution or better) of the encoder, and make an adapter PCB in say EasyEDA so you can order a set of 5 for a few euros ($2 + shipping) at JLCPCB. (It's really easy to do, and I certainly could do the PCB for you, if you took a picture with the board flat next to a ruler at the exact same distance from the camera.) This will only add 2mm to the thickness.
It may be that the Bourns ES series (shaftless!), say
ESD0D-S00-GC0006L (link to TME/AT) might be a better match: visually, the footprint and the dimensions seem to match very well (
PDF) except for the pin spacing; but, if we had a precise image of the Diehl PCB (flat, with a precise ruler next to it), we could check. The shaft itself can be made from 6mm plastic rod (PA66/nylon) with a lot of fettling with very few tools, to fit the existing knob.
So, if I may suggest, could you take another picture like the
raw.png above, but with something behind the PCB so that it is absolutely flat; and with a precise ruler (at the exact same level as the PCB) right next to the PCB? Making sure the camera is exactly centered on top of the board, so the image of the board is square and not a trapezoid? With 2× to 3× the resolution, so I can make a dimensionally accurate SVG to represent it? Also, you should measure the thickness of the Diehl encoder, and precise dimensions of the stem and feet.