encoding

Salat

Regular
Joined
Mar 5, 2002
Messages
81
Location
Poland, Silesia
I'm useing filestrem and stremreader to read some data form a file. This file contains some polish characters and I can't handle with the encodeing. I've searched the msdn but I still don't get it...

please help me...
 
I'm uesing such a code:
Visual Basic:
        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ów
            TipsOfDay(i) = r
        Next
koniecczytaniatipów:
        fr.Close() : fs.Close()
When it read form file, the text dosn't consist polish characters, what shell I do then?

I'm beging You... please help me....
 
that's a tough one i've 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 can't read...

i'm just kinda brainstorming... i'd look into Resource Files if i were

good luck
 
hm... I realy don't 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 it's something with the streamreader. I've 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 don't want to change any setting aplied with languages. Some programs I've write before didn't run properly on diffrent languages systems. (I'm 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 don't know what encoding it is, just try all of them.
 
Back
Top