encoding handling from xml