diff -ruN CVS/classpath/gnu/java/nio/charset/Cp874.java updated/classpath/gnu/java/nio/charset/Cp874.java
--- CVS/classpath/gnu/java/nio/charset/Cp874.java	2007-11-23 18:12:16.000000000 +0300
+++ updated/classpath/gnu/java/nio/charset/Cp874.java	2010-03-24 11:54:20.000000000 +0300
@@ -1,5 +1,5 @@
 /* Cp874.java -- Charset implementation for the Cp874 character set.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -43,7 +43,7 @@
   /**
    * This is the lookup table for this encoding
    */
-    private static final char[]	lookup =
+    static final char[] lookup =
     {
 	0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 
 	0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 
diff -ruN CVS/classpath/gnu/java/nio/charset/MS874.java updated/classpath/gnu/java/nio/charset/MS874.java
--- CVS/classpath/gnu/java/nio/charset/MS874.java	2007-11-23 18:12:16.000000000 +0300
+++ updated/classpath/gnu/java/nio/charset/MS874.java	2010-03-24 11:54:20.000000000 +0300
@@ -1,5 +1,5 @@
 /* MS874.java -- Charset implementation for the MS874 Thai character set.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -40,48 +40,11 @@
 public final class MS874 extends ByteCharset
 {
 
-  /**
-   * This is the lookup table for this encoding
-   */
-    private static final char[]	lookup =
-    {
-	0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 
-	0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 
-	0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 
-	0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 
-	0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 
-	0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 
-	0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 
-	0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 
-	0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 
-	0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 
-	0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 
-	0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 
-	0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 
-	0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 
-	0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 
-	0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 
-	0x20AC,   NONE,   NONE,   NONE,   NONE, 0x2026,   NONE,   NONE, 
-	NONE,     NONE,   NONE,   NONE,   NONE,   NONE,   NONE,   NONE, 
-	NONE,   0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 
-	NONE,     NONE,   NONE,   NONE,   NONE,   NONE,   NONE,   NONE, 
-	0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07, 
-	0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F, 
-	0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17, 
-	0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F, 
-	0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27, 
-	0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F, 
-	0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37, 
-	0x0E38, 0x0E39, 0x0E3A,   NONE,   NONE,   NONE,   NONE, 0x0E3F, 
-	0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47, 
-	0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F, 
-	0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 
-	0x0E58, 0x0E59, 0x0E5A, 0x0E5B,   NONE,   NONE,   NONE,   NONE
-    };
+    // The lookup table is the same as in Cp874.
 
     public MS874()
     {
-	super("MS874", new String[] {}, lookup);
+        super("MS874", new String[] {}, Cp874.lookup);
     }
 
 } // class MS874
diff -ruN CVS/classpath/gnu/java/nio/charset/Provider.java updated/classpath/gnu/java/nio/charset/Provider.java
--- CVS/classpath/gnu/java/nio/charset/Provider.java	2007-11-23 18:12:18.000000000 +0300
+++ updated/classpath/gnu/java/nio/charset/Provider.java	2010-03-24 11:54:20.000000000 +0300
@@ -1,5 +1,5 @@
 /* Provider.java -- 
-   Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005, 2006, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -106,6 +106,9 @@
     // UTF-16
     addCharset (new UTF_16 ());
 
+    // UTF-16BE (marked)
+    addCharset (new UnicodeBig ());
+
     // UTF-16LE (marked)
     addCharset (new UnicodeLittle ());
 
diff -ruN CVS/classpath/gnu/java/nio/charset/UTF_16.java updated/classpath/gnu/java/nio/charset/UTF_16.java
--- CVS/classpath/gnu/java/nio/charset/UTF_16.java	2005-07-02 23:32:14.000000000 +0300
+++ updated/classpath/gnu/java/nio/charset/UTF_16.java	2010-03-24 11:54:20.000000000 +0300
@@ -1,5 +1,5 @@
 /* UTF_16.java -- 
-   Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -38,6 +38,8 @@
 
 package gnu.java.nio.charset;
 
+import gnu.classpath.SystemProperties;
+
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
@@ -57,7 +59,7 @@
         /* These names are provided by
          * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
          */
-        "ISO-10646-UCS-2", "unicode", "csUnicode", "ucs-2", "UnicodeBig"
+        "ISO-10646-UCS-2", "unicode", "csUnicode", "ucs-2"
     });
   }
 
@@ -75,6 +77,9 @@
 
   public CharsetEncoder newEncoder ()
   {
-    return new UTF_16Encoder (this, UTF_16Encoder.BIG_ENDIAN, true);
+    return new UTF_16Encoder(this,
+            "UnicodeLittle".equals(
+                SystemProperties.getProperty("sun.io.unicode.encoding")) ?
+            UTF_16Encoder.LITTLE_ENDIAN : UTF_16Encoder.BIG_ENDIAN, true);
   }
 }
diff -ruN CVS/classpath/gnu/java/nio/charset/UnicodeBig.java updated/classpath/gnu/java/nio/charset/UnicodeBig.java
--- CVS/classpath/gnu/java/nio/charset/UnicodeBig.java	1970-01-01 03:00:00.000000000 +0300
+++ updated/classpath/gnu/java/nio/charset/UnicodeBig.java	2010-03-24 11:54:20.000000000 +0300
@@ -0,0 +1,73 @@
+/* UnicodeBig.java --
+   Copyright (C) 2010  Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio.charset;
+
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+
+/**
+ * UTF-16 big endian with a byte-order mark
+ *
+ * @author Ivan Maidanski
+ */
+final class UnicodeBig extends Charset
+{
+  UnicodeBig ()
+  {
+    super ("UnicodeBig", new String[] {});
+  }
+
+  public boolean contains (Charset cs)
+  {
+    return cs instanceof US_ASCII || cs instanceof ISO_8859_1
+      || cs instanceof UTF_8 || cs instanceof UTF_16BE
+      || cs instanceof UTF_16LE || cs instanceof UTF_16;
+  }
+
+  public CharsetDecoder newDecoder ()
+  {
+    return new UTF_16Decoder (this, UTF_16Decoder.MAYBE_BIG_ENDIAN);
+  }
+
+  public CharsetEncoder newEncoder ()
+  {
+    return new UTF_16Encoder (this, UTF_16Encoder.BIG_ENDIAN, true);
+  }
+}
diff -ruN CVS/classpath/gnu/java/nio/charset/UnicodeLittle.java updated/classpath/gnu/java/nio/charset/UnicodeLittle.java
--- CVS/classpath/gnu/java/nio/charset/UnicodeLittle.java	2005-11-14 02:18:24.000000000 +0400
+++ updated/classpath/gnu/java/nio/charset/UnicodeLittle.java	2010-05-16 14:58:16.000000000 +0400
@@ -1,5 +1,5 @@
 /* UnicodeLittle.java -- 
-   Copyright (C) 2005  Free Software Foundation, Inc.
+   Copyright (C) 2005, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -45,8 +45,7 @@
 /**
  * UTF-16 little endian with a byte-order mark
  * Included for java.io completeness.
- * ("UTF-16" is equal to UnicodeBig, and 
- * UTF-16BE/LE do not have a BOM
+ * (UTF-16BE/LE do not have a BOM.)
  */
 final class UnicodeLittle extends Charset
 {
