Decodes appropriate encodings