Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
When Encore is used, the Pokemon being encored will *sometimes* target the Pokemon not selected by the user. Other times, it will hit the correct target.