473,397 Members | 2,028 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,397 software developers and data experts.

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 6746
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: lawrence | last post by:
Someone on www.php.net suggested using a seems_utf8() method to test text for UTF-8 character encoding but didn't specify how to write such a method. Can anyone suggest a test that might work?...
27
by: Eric | last post by:
Assume that disk space is not an issue (the files will be small < 5k in general for the purpose of storing preferences) Assume that transportation to another OS may never occur. Are there...
40
by: Peter Row | last post by:
Hi all, Here is my problem: I have a SQL Server 2000 DB with various NVarChar, NText fields in its tables. For some stupid reason the data was inserted into these fields in UTF8 encoding. ...
9
by: Andy | last post by:
I am trying to write a for loop that will print all the ISO-Latin characters to a database. However: I am not sure exactly how to go about printing the ISO-Latin character set. Would anyone be...
9
by: Mark | last post by:
I've run a few simple tests looking at how query string encoding/decoding gets handled in asp.net, and it seems like the situation is even messier than it was in asp... Can't say I think much of the...
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
13
by: Martin Herbert Dietze | last post by:
Hi, I need to calculate the physical length of text in a text input. The term "physical" means in this context, that I consider 7bit-Ascii as one-byte-per character. Other characters may be...
0
by: yuvalbra | last post by:
Hello , I work with asp and send email by cdonts and want to get in in 1255 ISO-Logical encoding every email i got the numbers shows backwords , i need to goto to encoding and replace to...
1
by: Hvid Hat | last post by:
Hello How should I go about marking certain words in a text? I've got a list of words: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="Mark.xsl"?> <Words>...
4
by: =?ISO-8859-1?Q?Nordl=F6w?= | last post by:
How do I efficiently determine which possible encoding(s) a given text is in? Can I use the iconv.h api somehow? Thanks in advance, Nordlöw
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.