mono/mono — pull request #622 by killabytenow (2013-04-29 20:38:11+00:00)
Title: UTF8 encoding/decoding improvements

This patch is a modification of the file `/mono/mcs/class/corlib/System.Text/UTF8Encoding.cs` with some minor changes in other generic classes in `System.Text`.

It coverts the following objectives:
- a complete UTF8 coder & decoder implementation,
- it is at least as much efficient as the old implementation,
- better error handling and quick resync when bad sequences are found,
- fix the index field in the Fallback exceptions (it is a key feature if one
program want to handle strings with errors),
- refactorize and make code more maintainable,
- full compatibility with the .NET implementation (behaviour is exactly the
same in front of bad and good sequences),
- complete some pending or incomplete features (`MonoTODO`) like
`Encoder::FallbackException::IsUnknownSurrogate()` or use of BOM
preambles.