added check on encoding from config