fix encoding-related error