468,740 Members | 2,105 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,740 developers. It's quick & easy.

Text.Encoding... ISO-8859-1

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
3 6147
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
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
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.

Similar topics

9 posts views Thread by lawrence | last post: by
27 posts views Thread by Eric | last post: by
9 posts views Thread by Andy | last post: by
9 posts views Thread by Mark | last post: by
10 posts views Thread by joelagnel | last post: by
13 posts views Thread by Martin Herbert Dietze | last post: by
1 post views Thread by Hvid Hat | last post: by
4 posts views Thread by =?ISO-8859-1?Q?Nordl=F6w?= | last post: by
1 post views Thread by CARIGAR | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.