パッケージ org.opengion.fukurou.util

クラス UnicodeCorrecter


  • public final class UnicodeCorrecter
    extends java.lang.Object
    unicode と、JIS との文字コードの関係で、変換しています。
     http://www.ingrid.org/java/i18n/encoding/ja-conv.html
    
     0x00a2 ⇒ 0xffe0         ¢ (1-81, CENT SIGN)
     0x00a3 ⇒ 0xffe1         £ (1-82, POUND SIGN)
     0x00a5 ⇒ 0x005c         \ (D/12, YEN SIGN)
     0x00ac ⇒ 0xffe2         ¬ (2-44, NOT SIGN)
     0x2016 ⇒ 0x2225         ∥ (1-34, DOUBLE VERTICAL LINE)
     0x203e ⇒ 0x007e         ~ (F/14, OVERLINE)
     0x2212 ⇒ 0xff0d         - (1-61, MINUS SIGN)
     0x301c ⇒ 0xff5e         ~ (1-33, WAVE DASH)
    
     それぞれコード変換します。
     
    変更履歴:
    5.9.3.3 (2015/12/26) fukurou.mailパッケージからutilに移動し、機能追加
    バージョン
    4.0
    作成者
    Kazuhiko Hasegawa
    導入されたバージョン:
    JDK5.0,
    • メソッドの概要

      すべてのメソッド staticメソッド concreteメソッド 
      修飾子とタイプ メソッド 説明
      static char correctToCP932​(char ch)
      キャラクタ単位に、Unicode 文字の補正を行います。
      static java.lang.String correctToCP932​(java.lang.String str)
      Unicode 文字列の補正を行います。
      static java.lang.String correctToCP932​(java.lang.String str, java.lang.String enc)
      Unicode 文字列の補正を行います。
      • クラスから継承されたメソッド java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • メソッドの詳細

      • correctToCP932

        public static java.lang.String correctToCP932​(java.lang.String str)
        Unicode 文字列の補正を行います。 "MS932" コンバータでエンコードしようとした際に 正常に変換できない部分を補正します。
        パラメータ:
        str - 入力文字列
        戻り値:
        Unicode文字列の補正結果
      • correctToCP932

        public static java.lang.String correctToCP932​(java.lang.String str,
                                                      java.lang.String enc)
        Unicode 文字列の補正を行います。 encodeがSJIS,Shift_JIS,Windows31J,CP932の場合のみ変換を適用します
        パラメータ:
        str - 入力文字列
        enc - エンコード
        戻り値:
        Unicode文字列の補正結果
      • correctToCP932

        public static char correctToCP932​(char ch)
        キャラクタ単位に、Unicode 文字の補正を行います。 風間殿のページを参考にしています。
        パラメータ:
        ch - 入力文字
        戻り値:
        Unicode文字の補正結果
        関連項目:
        http://www.ingrid.org/java/i18n/encoding/ja-conv.html