Encoding check through function