Hi @Henri Hein ,
In UTF8Encoding Class Document:
With error detection enabled, a method that detects an invalid sequence of characters or bytes throws an ArgumentException exception. Without error detection, no exception is thrown, and the invalid sequence is generally ignored.
So if you want to use ASCIIEncoding class, you need to manually throws an ArgumentException exception when an invalid sequence of characters or bytes occurs.
Hope it could be helpful.
Best Regards,
Xingyu Zhao
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.