473,379 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Converting string in iso-8859-1 format to unicode

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
Nov 18 '05 #1
1 1937
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
jo*********@gmx.net
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: knocker | last post by:
Hi I have a problem with JSP on websphere 5. When I try save information with swedish or danish ÅÄÖ characters, the string is cut where the first of these characters occurs. The JDK used is...
6
by: Alex Neumann | last post by:
Hi, I need a function which converts an string to an integer. Currently I have this: bool string2int(char* digit, int& result) { result = 0; if (!(*digit >= '0' && *digit <='9'))
15
by: Bushido Hacks | last post by:
Hey c.l.c++ and/or c.g.a.opengl posters, How do I convert a hexidecimal string, traditionally used for defining colors with HTML, into a floating point array? In other words, how do I convert...
1
by: Erinys | last post by:
Hi, I need to access the individual bytes in a string in my javascript function. If the characters in the string were all ascii characters then there would not be a problem, however in my case...
5
by: scott | last post by:
hi all, hope some one can help me, this prob is driving me mad. im using sockets to communicate between a client and a server. I don't' have control over the client and how it sends the data...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
9
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived)...
6
by: Michael | last post by:
Hi, I had a look in FAQ but couldn't find any (what seemed to be) similar questions to this. Doubtless there is one, but I can't see it. Anyway...... If I have an int, say 1234, and I need to...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
3
by: Kevin Frey | last post by:
I am porting Managed C++ code from VS2003 to VS2005. Therefore adopting the new C++/CLI syntax rather than /clr:oldSyntax. Much of our managed code is concerned with interfacing to native C++...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.