[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-user
Subject:    [codec] - Issue in decoding quote-printable string
From:       Mufaddal Rampurawala <mufaddal.rampurawala () gmail ! com>
Date:       2020-03-13 7:56:20
Message-ID: CAMnMjq5cNDG5RDZimOxmCxz9ZmJvm1V8jpiUEDcF7ryTi8zcLg () mail ! gmail ! com
[Download RAW message or body]


Hi,

I am using java program to decode quote-printable encoded string (mentioned
in code) which is coming in the email body. While doing so, when I test
code standalone in windows/unix machine it works fine but when I run it via
Siebel CRM which has its own JVM instance running it is throwing me below
error :

Error: org.apache.commons.codec.DecoderException: Invalid URL encoding: not
a valid digit (radix 16): 13

I found that 13 (mentioned at end of error) is decimal representation of
"\r" character, if I replace "\r\n" with "\n" considering that maybe unix
is not understanding "\r" character but I get same error just it replace 13
with 10 that means its not understanding either of them.

Code :

String str = "<meta http-equiv=\"Content-Type\"
content=\"text/html; charset=utf-8\"><d=\r\n" +
                        "iv dir=\"ltr\"><div><img
src=\"cid:ii_k7em1jv90\" alt=\"image.png\" width=\r\n" +
                        "=\"520\"
height=\"251\"><br></div><div><br></div><div><div><img
src=\"cid:=\r\n" +
                        "ii_k7em29jm1\" alt=\"image.png\"
width=\"520\" height=\"381\"><br></div></di=\r\n" +
                        "v><div><br></div><div><div><img
src=\"cid:ii_k7em2x832\" alt=\"image.png\" =\r\n" +
                        "width=\"520\"
height=\"193\"><br></div></div></div>" ;

                System.out.println(new
String(QuotedPrintableCodec.decodeQuotedPrintable(str.getBytes())));`

I even tried using System.lineSeparator() to mitigate platform specific
definition of line feed but it also didn't worked, What am I doing wrong
here?
Regards,
Mufaddal Rampurawala


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic