Writing a outlook msg file using java

  • Follow


Hi,
I am writing a code that reads data (in bytes) from URL stream and
writes the bytes to a BufferedInputStream (msg file).
When i compare the CONTENT-LENGTH value with the bytes written, i see
some difference in bytes.
After checking on Java forums, i found that the MSG files are encoded
and i need to use a UNICODE decoder. Can you please help me out in
finding one. Please let me know as its kind of urgent.


Thanks and Regards,
Mradul
0
Reply Mradul 1/12/2008 1:20:45 PM

On Jan 12, 8:20=A0am, Mradul <mradul.kaus...@gmail.com> wrote:
> Hi,
> I am writing a code that reads data (in bytes) from URL stream and
> writes the bytes to a BufferedInputStream (msg file).
> When i compare the CONTENT-LENGTH value with the bytes written, i see
> some difference in bytes.
> After checking on Java forums, i found that the MSG files are encoded
> and i need to use a UNICODE decoder. Can you please help me out in
> finding one. Please let me know as its kind of urgent.
>
> Thanks and Regards,
> Mradul

See if this helps: http://www.exampledepot.com/egs/java.nio.charset/ConvertC=
har.html
0
Reply Jason 1/12/2008 7:47:16 PM


Jason.Herald@gmail.com wrote:
> On Jan 12, 8:20 am, Mradul <mradul.kaus...@gmail.com> wrote:
>> Hi,
>> I am writing a code that reads data (in bytes) from URL stream and
>> writes the bytes to a BufferedInputStream (msg file).
>> When i compare the CONTENT-LENGTH value with the bytes written, i see
>> some difference in bytes.
>> After checking on Java forums, i found that the MSG files are encoded
>> and i need to use a UNICODE decoder. Can you please help me out in
>> finding one. Please let me know as its kind of urgent.
>>
>> Thanks and Regards,
>> Mradul
> 
> See if this helps: http://www.exampledepot.com/egs/java.nio.charset/ConvertChar.html

Or how about using Readers and Writers instead of Streams, since the former 
are encoding-aware?

-- 
Lew
0
Reply Lew 1/12/2008 8:09:19 PM

On Sat, 12 Jan 2008 05:20:45 -0800 (PST), Mradul
<mradul.kaushik@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>After checking on Java forums, i found that the MSG files are encoded
>and i need to use a UNICODE decoder. Can you please help me out in
>finding one. Please let me know as its kind of urgent

Java works internally with 16-bit chars.  These are usually converted
to 8-bit chars or char-combos externally.  There are scores of
possible encodings.  Sometimes they are written with 16-bit Unicode
chars, bit or little endian, with or without BOMs.

see http://mindprod.com/jgloss/unicode.html
http://mindprod.com/jgloss/bom.html

You need to identify the one you need to generate. I  have written a
little utility to help.  See 

http://mindprod.com/jgloss/applet/encodingrecogniser.html

You also need some background on encoding.

see http://mindprod.com/jgloss/encoding.html

You also need code to generate and read encoded files. See 
http://mindprod.com/applet/fileio.html

Sorry to give you so much reading, but encodings are trickier than you
might first imagine.
-- 
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com
0
Reply Roedy 1/12/2008 9:06:36 PM

Roedy Green skrev:> > http://mindprod.com/jgloss/applet/encodingrecogniser.html> I get a 404 with that URL.
0
Reply Lars 1/12/2008 9:21:58 PM

On Sat, 12 Jan 2008 21:21:58 GMT, Lars Enderin
<lars.enderin@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>http://mindprod.com/jgloss/applet/encodingrecogniser.html
>> 
>I get a 404 with that URL.

that should read
http://mindprod.com/applet/encodingrecogniser.html
-- 
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com
0
Reply Roedy 1/13/2008 8:44:57 AM

On Jan 13, 2:06 am, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> On Sat, 12 Jan 2008 05:20:45 -0800 (PST), Mradul
> <mradul.kaus...@gmail.com> wrote, quoted or indirectly quoted someone
> who said :
>
> >After checking on Java forums, i found that the MSG files are encoded
> >and i need to use a UNICODE decoder. Can you please help me out in
> >finding one. Please let me know as its kind of urgent
>
> Java works internally with 16-bit chars.  These are usually converted
> to 8-bit chars or char-combos externally.  There are scores of
> possible encodings.  Sometimes they are written with 16-bit Unicode
> chars, bit or little endian, with or without BOMs.
>
> seehttp://mindprod.com/jgloss/unicode.htmlhttp://mindprod.com/jgloss/bom.html
>
> You need to identify the one you need to generate. I  have written a
> little utility to help.  See
>
> http://mindprod.com/jgloss/applet/encodingrecogniser.html
>
> You also need some background on encoding.
>
> seehttp://mindprod.com/jgloss/encoding.html
>
> You also need code to generate and read encoded files. Seehttp://mindprod.com/applet/fileio.html
>
> Sorry to give you so much reading, but encodings are trickier than you
> might first imagine.
> --
> Roedy Green, Canadian Mind Products
> The Java Glossary,http://mindprod.com

Thanks a lot Roedy for this info. I am just going through the
procedure that you utilized and trying to implement in my scenario and
in case of any problems I will contact you via this thread.
-1
Reply Mradul 1/13/2008 8:28:05 PM

Easy solution is JMSG API. Supports ASCII and Unicode .msg files

http://www.independentsoft.de
0
Reply OOOKiki (1) 7/24/2012 5:45:10 PM

7 Replies
537 Views

(page loaded in 0.173 seconds)

Similiar Articles:













7/19/2012 3:56:20 PM


Reply: