More encoding fixes in exporttool.