2009-02-04 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 4 Feb 2009 04:23:38 +0000 (04:23 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 4 Feb 2009 04:23:38 +0000 (04:23 -0000)
* UTF32Encoding.cs : fixed wrong range in GetByteCount(). Patch by
  David Michell.

svn path=/trunk/mcs/; revision=125648

mcs/class/corlib/System.Text/ChangeLog
mcs/class/corlib/System.Text/UTF32Encoding.cs

index 2abe2d9d23e61a65c5d0dbdaa8f089b6bec65be7..72a707116d9538774a2e7e115efe3cfb06449721 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-04  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * UTF32Encoding.cs : fixed wrong range in GetByteCount(). Patch by
+         David Michell.
+
 2009-01-30  Atsushi Enomoto  <atsushi@ximian.com>
 
        * UTF8Encoding.cs : surrogate characters are handled in 
index 833178bd729d37c5a23aeb7283893a69317ba5fa..7d5129616283ebe5127d1aacfb046b2c7e6f3b58 100644 (file)
@@ -103,7 +103,7 @@ public sealed class UTF32Encoding : Encoding
                        throw new ArgumentOutOfRangeException ("count", _("ArgRange_Array"));
                }
                int ret = 0;
-               for (int i = index; i < count; i++) {
+               for (int i = index; i < index + count; i++) {
                        if (Char.IsSurrogate (chars [i])) {
                                if (i + 1 < chars.Length && Char.IsSurrogate (chars [i + 1]))
                                        ret += 4;