By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

Text.Encoding... ISO-8859-1

P: n/a
is there easy way encode ISO-8859-1 (7-bit) to unicode?

example..
=?iso-8859-1?Q?=F6=E4?=
to
öä

I tried Dim iso8859 As System.Text.Encoding =
System.Text.Encoding.GetEncoding("ISO-8859-1")
and getDecoder, but I didn't manage to get it work...
Cheers, Ville
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ville,
I've never needed to call GetDecoder directly.

Normally I apply the encoding I need to the Stream object I am using via a
StreamReader class, something like:

Dim stream As Stream ' file or network stream where your data is
Dim encoding As Encoding = Encoding.GetEncoding("ISO-8859-1")
Dim reader As New StreamReader(stream, encoding)
Dim line As String = reader.ReadLine()

If I have the encoded text in a Byte array, then I simply use the GetBytes &
GetString method of the encoding object.

Dim bytes() As Byte = encoding.GetBytes("this is a string")
Dim str As String = encoding.GetString(bytes)

Hope this helps
Jay

"Ville Pirhonen" <vi************@profimill.com> wrote in message
news:Ot**************@TK2MSFTNGP09.phx.gbl...
is there easy way encode ISO-8859-1 (7-bit) to unicode?

example..
=?iso-8859-1?Q?=F6=E4?=
to
öä

I tried Dim iso8859 As System.Text.Encoding =
System.Text.Encoding.GetEncoding("ISO-8859-1")
and getDecoder, but I didn't manage to get it work...
Cheers, Ville

Nov 20 '05 #2

P: n/a
if you are converting strings to strings there may be errors.
your could be more specific about your code, 2 or 3 lines would be enough
Ville Pirhonen wrote:
is there easy way encode ISO-8859-1 (7-bit) to unicode?

example..
=?iso-8859-1?Q?=F6=E4?=
to
?

I tried Dim iso8859 As System.Text.Encoding =
System.Text.Encoding.GetEncoding("ISO-8859-1")
and getDecoder, but I didn't manage to get it work...
Cheers, Ville


Nov 20 '05 #3

P: n/a
if you are converting strings to strings there may be errors.
your could be more specific about your code, 2 or 3 lines would be enough
Ville Pirhonen wrote:
is there easy way encode ISO-8859-1 (7-bit) to unicode?

example..
=?iso-8859-1?Q?=F6=E4?=
to
?

I tried Dim iso8859 As System.Text.Encoding =
System.Text.Encoding.GetEncoding("ISO-8859-1")
and getDecoder, but I didn't manage to get it work...
Cheers, Ville


Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.