I have an application which analyses website usage logs.
The program reads in a file to analyse.
I received the following error message when running the application:
System.ArgumentException: Found a high surrogate char without a following low surrogate at index: 546. This input may not be in this encoding, or may not contain valid unicode (UTF-16) characters.
Inspecting the website logs manually it seems there is some unexpected corrupt data within the file.
I was wondering if there was a way of catching this error to stop the program crashing?
Any help will be gratefully received.
The program reads in a file to analyse.
I received the following error message when running the application:
System.ArgumentException: Found a high surrogate char without a following low surrogate at index: 546. This input may not be in this encoding, or may not contain valid unicode (UTF-16) characters.
Inspecting the website logs manually it seems there is some unexpected corrupt data within the file.
I was wondering if there was a way of catching this error to stop the program crashing?
Any help will be gratefully received.