Use the chip DS26LS31 that converts the encoder A and B signals to differentials. The output signal from the encoder goes through a 74LS04 chip.