Converting string in iso-8859-1 format to unicode

Discussion in 'ASP .Net' started by Timiun, Dec 15, 2003.

  1. Timiun

    Timiun Guest

    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
    Timiun, Dec 15, 2003
    #1
    1. Advertising

  2. Timiun

    Joerg Jooss Guest

    Timiun wrote:

    > 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,
    --
    Joerg Jooss
    Joerg Jooss, Dec 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?iso-8859-1?b?Sulq6Q==?=

    [EXCEL] sequential =?iso-8859-1?q?acc=E8s=2E?=

    =?iso-8859-1?b?Sulq6Q==?=, Jan 23, 2004, in forum: Perl
    Replies:
    0
    Views:
    709
    =?iso-8859-1?b?Sulq6Q==?=
    Jan 23, 2004
  2. Jonck
    Replies:
    3
    Views:
    2,349
    Jonck
    Oct 25, 2004
  3. Franck DARRAS
    Replies:
    12
    Views:
    633
    Jim Higson
    Aug 23, 2004
  4. Peter Jacobi
    Replies:
    13
    Views:
    845
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Aug 3, 2004
  5. Replies:
    14
    Views:
    578
    Frederick Gotham
    Aug 7, 2006
Loading...

Share This Page