本稿では Java 言語を用いて文字列をURLエンコード/デコードする方法について解説します。 また URL エンコードにおける注意点についても解説します。 Java で利用できる URL エンコードクラス まずは Java で利用できる主な URL エンコードクラスを整理します。 次の2つから選択すれば良いでしょう。 java.net.URLEncoder / URLDecoder (Java標準) Apache Commons Codec の URLCodec クラス java.net.URLEncoder / URLDecoder を利用する例 Java 標準の java.net.URLEncoder と java.net.URLDecoder を利用する場合は、次のようにプログラムを書きます。 String target = "テストメッセージ"; // エンコードの例 Strin