Why not just assume from the extension if the encoding is not there?