Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Issue : java.io.UnsupportedEncodingException: utf-7

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Issue : java.io.UnsupportedEncodingException: utf-7

    Hi All

    I am facing an issue with my Emailagent java program. Currently the program it supports for UTF-8.it is not suppoting to utf-7. Incase any email comes with utf7 format it is getting failed and it is thrown an exception.
    I have tried many possibilities by adding Jcharset.jar and jutf-7 jar to the package, but nothing worked well..

    below are the exception detail:

    java.io.UnsupportedEncodingException: utf-7
    at sun.nio.cs.StreamDecoder.forInputStreamReader(Stre amDecoder.java:52)
    at java.io.InputStreamReader.<init>(InputStreamReader .java:83)
    at com.sun.mail.handlers.text_plain.getContent(text_p lain.java:107)
    at javax.activation.DataSourceDataContentHandler.getC ontent(DataHandler.java:775)
    at javax.activation.DataHandler.getContent(DataHandle r.java:522)
    at javax.mail.internet.MimeMessage.getContent(MimeMes sage.java:1453)
    at com.sforce.mail.ParsedMessage$EmailBody.<init>(Par sedMessage.java:549)
    at com.sforce.mail.ParsedMessage$EmailBody.<init>(Par sedMessage.java:514)
    at com.sforce.mail.ParsedMessage.<init>(ParsedMessage .java:210)
    at com.sforce.mail.GenericClient.handleMessage(Generi cClient.java:693)
    at com.sforce.mail.GenericClient.receive(GenericClien t.java:512)
    at com.sforce.mail.EmailService$EmailWorker.run(Email Service.java:221)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)


    Please any one help me how to resolve this issue..

    Thanks & Regards,
    Hari


  2. #2
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: Issue : java.io.UnsupportedEncodingException: utf-7

    Have you tried putting jcharset.jar into the locations mentioned at JCharset - Java Charset package? E.g., I've tried putting it into jre/lib/ext/, and this works for me.

  3. #3
    Junior Member
    Join Date
    Jun 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Issue : java.io.UnsupportedEncodingException: utf-7

    Thanks Jashburn.

    Let me try this aswell.. So you want me to place the JCharset.jar file under -- jrockit-jdk-1.6.0_45/jre/lib/ext location right.
    And after that Server restart necessary ??.

    Thanks & Regards,
    Hari

  4. #4
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: Issue : java.io.UnsupportedEncodingException: utf-7

    You're welcome.

    You can try placing the jar file there and restart the server. If you have looked through the link I provided, you'd see that there are a few other locations where you can place the jar file. Just try it. Restart the server as necessary.

    Note: I previously tested this using a standalone program running on an Oracle JRE.

  5. #5
    Junior Member
    Join Date
    Jun 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Issue : java.io.UnsupportedEncodingException: utf-7

    Yes, It's working fine without error .. Thanks Jashburn

Similar Threads

  1. Parsing error for UTF-16 file.
    By kcs87 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: August 6th, 2013, 02:20 PM
  2. Encryption password by java MD5 and UTF-8
    By jahirul019 in forum What's Wrong With My Code?
    Replies: 15
    Last Post: October 6th, 2012, 05:35 PM
  3. Java Issue / Cache issue
    By VisualPK in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 14th, 2012, 08:43 PM
  4. Convert file from any encoding to UTF-8
    By efluvio in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: June 26th, 2011, 01:16 AM
  5. UTF - 8 / Byte Stream
    By JavaCODER in forum File I/O & Other I/O Streams
    Replies: 5
    Last Post: October 16th, 2010, 02:26 PM