src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java

Print this page




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.nio.cs.ext;
  27 
  28 import java.nio.ByteBuffer;
  29 import java.nio.CharBuffer;
  30 import java.nio.charset.Charset;
  31 import java.nio.charset.CharsetDecoder;
  32 import java.nio.charset.CharsetEncoder;
  33 import java.nio.charset.CoderResult;
  34 import java.nio.charset.CodingErrorAction;


  35 import sun.nio.cs.HistoricallyNamedCharset;
  36 import sun.nio.cs.Surrogate;
  37 import sun.nio.cs.US_ASCII;

  38 import static sun.nio.cs.CharsetMapping.*;
  39 
  40 /*
  41  * Implementation notes:
  42  *
  43  * (1)"Standard based" (ASCII, JIS_X_0201 and JIS_X_0208) ISO2022-JP charset
  44  * is provided by the base implementation of this class.
  45  *
  46  * Three Microsoft ISO2022-JP variants, MS50220, MS50221 and MSISO2022JP
  47  * are provided via subclasses.
  48  *
  49  * (2)MS50220 and MS50221 are assumed to work the same way as Microsoft
  50  * CP50220 and CP50221's 7-bit implementation works by using CP5022X
  51  * specific JIS0208 and JIS0212 mapping tables (generated via Microsoft's
  52  * MultiByteToWideChar/WideCharToMultiByte APIs). The only difference
  53  * between these 2 classes is that MS50220 does not support singlebyte
  54  * halfwidth kana (Uff61-Uff9f) shiftin mechanism when "encoding", instead
  55  * these halfwidth kana characters are converted to their fullwidth JIS0208
  56  * counterparts.
  57  *




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.nio.cs.ext;
  27 
  28 import java.nio.ByteBuffer;
  29 import java.nio.CharBuffer;
  30 import java.nio.charset.Charset;
  31 import java.nio.charset.CharsetDecoder;
  32 import java.nio.charset.CharsetEncoder;
  33 import java.nio.charset.CoderResult;
  34 import java.nio.charset.CodingErrorAction;
  35 import sun.nio.cs.DelegatableDecoder;
  36 import sun.nio.cs.DoubleByte;
  37 import sun.nio.cs.HistoricallyNamedCharset;
  38 import sun.nio.cs.Surrogate;
  39 import sun.nio.cs.US_ASCII;
  40 import sun.nio.cs.*;
  41 import static sun.nio.cs.CharsetMapping.*;
  42 
  43 /*
  44  * Implementation notes:
  45  *
  46  * (1)"Standard based" (ASCII, JIS_X_0201 and JIS_X_0208) ISO2022-JP charset
  47  * is provided by the base implementation of this class.
  48  *
  49  * Three Microsoft ISO2022-JP variants, MS50220, MS50221 and MSISO2022JP
  50  * are provided via subclasses.
  51  *
  52  * (2)MS50220 and MS50221 are assumed to work the same way as Microsoft
  53  * CP50220 and CP50221's 7-bit implementation works by using CP5022X
  54  * specific JIS0208 and JIS0212 mapping tables (generated via Microsoft's
  55  * MultiByteToWideChar/WideCharToMultiByte APIs). The only difference
  56  * between these 2 classes is that MS50220 does not support singlebyte
  57  * halfwidth kana (Uff61-Uff9f) shiftin mechanism when "encoding", instead
  58  * these halfwidth kana characters are converted to their fullwidth JIS0208
  59  * counterparts.
  60  *