Reading a not UTF-8 encoding file

L

leticia larrosa

Hi,

I try to read a file that have 8 bit character, but contain some
character
whose code is more than 128 (spanish character).

When I read this file using ASCII (Dim oRead As StreamReader = New
StreamReader("C:\...\name.txt", System.Text.Encoding.ASCII)), this
special characters aren't appear.

If I try red this file with some unicode like UTF-8(the defualt
encodign for the OpenText() ) of course that did't work, because of
this character don't have 16 bit.
I'm not an expert of unicode matter.

Can someone help me reading this type of file for show his content in
web page.

Thank
 
C

Cor

Hi Leticia,

ASCII is 7 bit.

You have to use the Unicode. But I asume you are working in Spanish, why you
want to encode a Spanish characterset to a Spanish characterset?

Cor
 
?

=?ISO-8859-15?Q?Jos=E9_Manuel_Ag=FCero?=

Hello, leticia:

If the file was written in Windows it has probably ANSI encoding:
Dim oRead As StreamReader = New StreamReader("C:\...\name.txt", System.Text.Encoding.Default)

If it was written in DOS it was probably encoded with codepage 850:
Dim oRead As StreamReader = _
New StreamReader("C:\...\name.txt", New System.Text.Encoding(850))

If it was encoded with other codepage, substitute 850 with the codepage number. For example, US codepage is 437.

Regards.


"leticia larrosa" <[email protected]> escribió en el mensaje | Hi,
|
| I try to read a file that have 8 bit character, but contain some
| character
| whose code is more than 128 (spanish character).
|
| When I read this file using ASCII (Dim oRead As StreamReader = New
| StreamReader("C:\...\name.txt", System.Text.Encoding.ASCII)), this
| special characters aren't appear.
|
| If I try red this file with some unicode like UTF-8(the defualt
| encodign for the OpenText() ) of course that did't work, because of
| this character don't have 16 bit.
| I'm not an expert of unicode matter.
|
| Can someone help me reading this type of file for show his content in
| web page.
|
| Thank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top