I think this would be the way to go if you want to use diodes, but I wouldnt do it this way.
How would you do it?
I agree with protokatie about keeping the encoder isolated from the counter and its power source.
But instead of using relays at 3-4 bucks each, i would use opto-isolators.
they arent much bigger than a diode and run around 50 cents to a dollar each. (depends on where you get them and how much it costs to ship, etc). Plus they make no noise, dont require suppressing diodes, and they should outlast a relay by several years.
You can also get dual opto-isolators which would supply both encoder inputs. they are two opto isolators in a single 8 pin DIP package. (Integrated circuit with 4 pins on each side.)
Plus, again agreeing with protokatie, I would much rather overkill something than under kill it.
Under killing something leaves the door open for it to bite you in the a**.
But if you feel comfortable about letting the encoder and counter circuits touch each other, then the diode drawing I showed should work fine. the relay shouldnt be necessary, but there are several ways to do something. Using relays would work too.
You could also use a relay to isolate the circuits, but the opto isolators will do the same thing cheaper and take up a fraction of the room.
I can post a drawing using optos if you'd like. I can also give you some links for more info about the optos. They are very easy to use, but do require some soldering skills.