fix encoding errors in file export