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が発生します)。
どうすればいいのでしょうか?
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 の再起動をすると、どうなるでしょうか?