JCharset(jcharset.jar)の使い方を教えてください。


Java1.6.0、Tomcat5.5.33の、SAStrutsでWebアプリケーションを作っています。

JavaMail(mail.jar)で、unicode-1-1-utf-7のメールをパースするとUnsupportedEncodingExceptionになって困っていて、調べたところJCharsetというものを使うと解決するようでした。

[調べたページ]
http://www.oracle.com/technetwork/java/javamail/faq/index.html
http://cfg11n.blogspot.jp/2005/06/utf-7.html

そこで、さっそく http://www.freeutils.net/source/jcharset/ で最新版の1.5をDLしたのですが、jcharset.jarというファイルをどう使えばいいのかよくわかりません。

README.txtを見たら
> runs on JDK 1.5 or later,
> and requires no special installation - just add jcharset.jar to your
> classpath, or place it in any of the usual extension directories.

とあったので、とりあえず WEB-INF/lib の下に置いてtomcat再起動してみましたが、特になにも変化ありません(UnsupportedEncodingExceptionが発生します)。

どうすればいいのでしょうか?

回答の条件
  • 1人10回まで
  • 登録:
  • 終了:2013/02/05 14:20:25
※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。

ベストアンサー

id:a-kuma3 No.1

回答回数4973ベストアンサー獲得回数2154

ポイント200pt

jCharset のページの記載です。


Note: Some web/mail containers run each application in its own JVM context. In this case check the container documentation for information on where and how to configure the classpath, such as in WEB-INF/lib, shared/lib, jre/lib/ext, etc. You may need to restart the server for changes to take effect. However, if you use Sun's JRE, it will work only if you put it in the jre/lib/ext extension directory, or in the container's classpath. This is due to a bug in Sun's JRE implementation (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4619777). Voting for the bug may expedite its fix, so please do...


jre/lib/ext に jcharset.jar を配置して、Tomcat の再起動をすると、どうなるでしょうか?

id:nacookan

解決しました!
ありがとうございました!

2013/02/05 14:20:13

コメントはまだありません

この質問への反応(ブックマークコメント)

「あの人に答えてほしい」「この質問はあの人が答えられそう」というときに、回答リクエストを送ってみてましょう。

これ以上回答リクエストを送信することはできません。制限について

回答リクエストを送信したユーザーはいません