Generic encoding/decoding detection