We are using a csv upload to add users. One of the requirements is to strip invalid characters (that are not in the Windows-1252 character set) from any text input fields during file processing. e.g. "Test象形字String" should result in "TestString". However when setting the file encoding using the following:
TxtLoadOptions loadOptions = new TxtLoadOptions(LoadFormat.CSV);
loadOptions.Encoding = Encoding.GetEncoding(1252);
all invalid characters are automatically converted to question marks. So the above string would be read from the file as "Test???String". A question mark is a valid Windows-1252 character and we can't assume a question mark is always invalid, as it can be valid for certain inputs.
Is there a way to stop this automatic conversion?