mono/mono — pull request #189 by pruiz (2011-11-15 23:59:50+00:00)
Title: Fixes bug #683475 (mono crashes due to CJK encodings)

- Fixed ISO2022JPEncoder's GetBytesCount(..) to avoid it from returning invalid calculations leading to buffer overflows during GetBytes(..).
- Fixed MonoEncoding::HandleFallback(..) off-by-one error when handling double-byte replacements.
- Fixed ISO2022JPEncoder::GetBytes(..) invalid translation of some full width characters (U+FF60 ~ U+FF0A) when using halfwide kana mapping.
- Fixed ISO2022JPEncoder::GetBytes(..) invalid translation of IDEOGRAPHIC SPACE (U+3000) character.
- Refactor of MonoEncoding::HandleFallback(..) to correctly support replacement of inv. characters by statefull encoders/encodings (like ISO-2022-JP).

NOTE: This fixes were found by creating alternative safe-only implementations of the actual CJK encoders. Such implementations are disabled by default for performance reasons, but can be enabled if needed by using the conditional compiling flag DISABLE_UNSAFE.