Post pics of encoder and part number of same + motor + use.
Voltage, resolution, type etc.
See if it has z/, z, aka an index.
If it has an index, the angular positioning of the encoder may be important.

Common quadrature encoders eat 5-24v dc, and interchange.
so a 10.000 count +z quad encoder from one manufacturer will work fine with another makes 10.000 count + z encoder.

The encoder needs to be fast enough for rpm x counts in khz.

Absolute encoders are a different set, and seem to be brand specific.

It is very different if the encoder is for a servo motor, spindle motor, or ballscrew secondary feedback.