Salat Posted February 27, 2003 Posted February 27, 2003 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... Quote profesjonalne programowanie na zlecenie :)
Salat Posted March 1, 2003 Author Posted March 1, 2003 I'm uesing such a 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ó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.... Quote profesjonalne programowanie na zlecenie :)
bpayne111 Posted March 1, 2003 Posted March 1, 2003 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 Quote i'm not lazy i'm just resting before i get tired.
Salat Posted March 2, 2003 Author Posted March 2, 2003 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... :) Quote profesjonalne programowanie na zlecenie :)
*Gurus* divil Posted March 2, 2003 *Gurus* Posted March 2, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.