fix hg encoding stuff