[fix] Fixed Encoder/Decoders' compatibilities #23771
Added unit tests to check API compatibilities.