jp.sourceforge.livez.lang
クラス WindowsEUCJP

java.lang.Object
  上位を拡張 jp.sourceforge.livez.lang.WindowsEUCJP

public final class WindowsEUCJP
extends Object

Windows 及び 携帯端末用の EUC-JP と Unicode の相互変換機能を提供するクラスです。

作成者:
杉澤 浩二

コンストラクタの概要
WindowsEUCJP()
           
 
メソッドの概要
static String decode(byte[] input)
          EUC-JP から Unicode へ変換(デコード)します。
static String decode(byte[] input, int length)
          EUC-JP から Unicode へ変換(デコード)します。
static byte[] encode(String input)
          Unicode から EUC_JP へ変換(エンコード)します。
static boolean isSJISKana(byte[] bytes)
          指定されたバイト列がシフトJISの半角カタカナである可能性があるかどうかを返します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

WindowsEUCJP

public WindowsEUCJP()
メソッドの詳細

encode

public static byte[] encode(String input)
Unicode から EUC_JP へ変換(エンコード)します。

パラメータ:
input - 変換する文字列
戻り値:
EUC-JP コードで表されたバイト配列

decode

public static String decode(byte[] input)
                     throws UnsupportedEncodingException
EUC-JP から Unicode へ変換(デコード)します。

パラメータ:
input - EUC コードで表されたバイト配列
戻り値:
Unicode へ変換された文字列
例外:
UnsupportedEncodingException

decode

public static String decode(byte[] input,
                            int length)
                     throws UnsupportedEncodingException
EUC-JP から Unicode へ変換(デコード)します。

パラメータ:
input - EUC コードで表されたバイト配列
length - input の処理する桁数
戻り値:
Unicode へ変換された文字列
例外:
UnsupportedEncodingException

isSJISKana

public static boolean isSJISKana(byte[] bytes)
指定されたバイト列がシフトJISの半角カタカナである可能性があるかどうかを返します。

パラメータ:
bytes - バイト列
戻り値:
シフトJISの半角カタカナである可能性


Copyright © 2005-2006 Kouji Sugisawa. All rights reserved.