encoding

Salat

Well-known member
Joined
Mar 5, 2002
Messages
81
Location
Poland, Silesia
Im useing filestrem and stremreader to read some data form a file. This file contains some polish characters and I cant handle with the encodeing. Ive searched the msdn but I still dont get it...

please help me...
 
Im uesing such a code:
Code:
        Dim fs As New IO.FileStream(Application.StartupPath & "\tipofday.dat", IO.FileMode.Open)
        Dim fr As New IO.StreamReader(fs)
        Dim i As Integer
        Dim r As String
        For i = 0 To 100
            r = fr.ReadLine
            If r = "" Then TipCount = i : GoTo koniecczytaniatip
 
thats a tough one ive never worked with that before...
have you looked into resources at all? you can change languages using a resource file

are the characters in ascii table? i guess not if you cant read...

im just kinda brainstorming... id look into Resource Files if i were

good luck
 
hm... I realy dont know what is wrong. I made a file with notepad and with polish special characters , set the ansii encodeing and save it. So every thing supose to work fine. I guess its something with the streamreader. Ive replace it with binaryreader and convert byte one by one it to string and it ok, the polish special characters are displayed properly.

by the way... I dont want to change any setting aplied with languages. Some programs Ive write before didnt run properly on diffrent languages systems. (Im talking about VB 5)

thanks any way... :)
 
If you know how the file is encoded with the special characters, you can specify that encoding when you create the streamreader. Most of the constructor overloads support specifying the encoding. If you dont know what encoding it is, just try all of them.
 
Back
Top