Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Converting string in iso-8859-1 format to unicode

Reply
Thread Tools

Converting string in iso-8859-1 format to unicode

 
 
Timiun
Guest
Posts: n/a
 
      12-15-2003
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
 
Reply With Quote
 
 
 
 
Joerg Jooss
Guest
Posts: n/a
 
      12-24-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: raw format string in string format method? Chris Angelico Python 3 03-01-2013 12:00 AM
Re: raw format string in string format method? Rick Johnson Python 0 02-28-2013 11:06 PM
Re: raw format string in string format method? Peter Otten Python 0 02-28-2013 03:41 PM
Converting from VCR tape format to AVI or mpg format on my hard drive Rock Gibbons Computer Support 6 04-06-2007 10:24 AM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM



Advertisments