Fixing encoding when reading imd xml.