Converting string in iso-8859-1 format to unicode

T

Timiun

Hey!

I got a rather anoying problem here.
I'm making a webmail application, that collects webmail from different
POP3 servers. Fine - it works - allmost.

The problem is encoding - or should I say lack of (i think)
When Outlook 2003 (danish) sends email, it encodes in iso-8859-1
When my mailserver (mercury/32) recives the mail, all ok, but when my
ASP.NET page retrives the mail from the server, it gets this (and
displays this):

*******************************************
=C6=F8=E5 =C6=D8=C5

S=E6delighed er ikke s=E5 sv=E6rt over =F8en
N=F8j - s=E5 =E6der hun den

Jesper Nygaard Schi=F8tt
*******************************************

Instead of this (the way it should look):

*******************************************
Æøå ÆØÅ

Sædelighed er ikke så svært over øen
Nøj - så æder hun den

Jesper Nygaard Schiøtt
*******************************************

Now, the question is how do I convert from the iso-8859-1 string to a
unicode (or something different) that my webmail app can show???

Cheers
Jesper
 
J

Joerg Jooss

Timiun said:
Hey!

I got a rather anoying problem here.
I'm making a webmail application, that collects webmail from
different POP3 servers. Fine - it works - allmost.

The problem is encoding - or should I say lack of (i think)
When Outlook 2003 (danish) sends email, it encodes in iso-8859-1
When my mailserver (mercury/32) recives the mail, all ok, but when my
ASP.NET page retrives the mail from the server, it gets this (and
displays this):

*******************************************
=C6=F8=E5 =C6=D8=C5

S=E6delighed er ikke s=E5 sv=E6rt over =F8en
N=F8j - s=E5 =E6der hun den

How do you retrieve E-mail from those POP3 server? Assuming you're
receiving bytes by a network stream, one proper way to decode them is

byte[] bytes = ... // stuff you receive via POP3
System.Text.Encoding iso88591 = System.Text.Encoding.GetEncoding(28591);
String mail = iso88591.GetBytes(bytes);

Cheers,
 

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top