- fixed a bug when reading encoding from XML