Description of Problem:
The IndexOutOfRangeException is thrown when calling:
where input contains Unicode surrogate pair, such as smiley.
Steps to reproduce the problem:
1. call this Encoding.GetEncoding("iso-8859-1").GetBytes("\ud83d\ude0a ");
IndexOutOfRangeException is thrown
No exception is thrown; three bytes are returned.
How often does this happen?
This BUG is new to Mono version 4.
I have tested this on Mono 22.214.171.124 and 3.2.8 (Debian) without exception.
The exception was risen on Mono 4.4.1.
Thank you for the bug report!
I implemented a fix in this pull request: https://github.com/mono/mono/pull/3489
This was merged to mono master/4b5eace32dc2c6353425f9ee75299b7fc3e43e02 and mono-4.6.0-branch/50e81ed6e587222f9af6b9d372ea7f798e145236