Using quadrature encoder with STM32 MCU
The encoder you are using is a simple mechanical wiper, it's almost impossible to debounce them with a simple RC circuit alone as shown in the datasheet. 

The capacitor you used is too big with delays out above 1 mS, the suggested 0.01 uF will give about 0.1 mS delay on a rising pulse and somewhat longer on a negative change. Neither value however will stop switch bounce affecting your count since the wiper is not itself a detent in this type of switch (in any I've worked with), the detents are a simple external shaft position detent. 

Internally they will look like this (or some similar physical layout):


One way I've handled these mechanical encoders in the past is to use a timer tick (1 kHz or so interrupt is usually readily available) to read the A/B values into a temporary 8 bit register and set my program accessible copy of A/B values only when there are 4 '1' bits accumulated for each of A/B.
This ensures values are not made program accessible unless there has been no change in A/B state for at least 4 mS. You can obviously change the tick to get any debounce value you want.