Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 3484 [details]
Simple test case
The DecoderFallbackException is not always thrown by the Decoder.Convert method, for instance, assuming a bad input byte array for this piece of code:
Encoding enc = Encoding.GetEncoding("XXX", new EncoderExceptionFallback(), new DecoderExceptionFallback());
Decoder dec = enc.GetDecoder();
dec.Convert(bytes, 0, 1, chars, 0, 1, true, out bytesUsed, out charsUsed, out completed);
This code will throw exceptions with the 'us-ascii' encoding as expected (array = 0xff), but it will work without exceptions with an incorrect 'utf-8' array (0xc3).
I've attached a simple test case with the output obtained under the MS implementation and the output running in a 2.10 mono environment. The MS implementation throws an Exception on both cases, Mono implementation only on the us-ascii try.
Thank you for the detailed bug report.
This issue is fixed in master and mono-3.8.0-branch.