I am trying to read a file that consists of rows of text. All works well except that special characters are not read correctly. What happens is that the variable "input" gets the first line correctly and all characters from the second except "åäöÅÄÖ" correctly. The special characters just disappear. I've been trying to use "unicode" while declaring the objReader but it didn't work. Now I'm out of ideas. Help please?
The code I'm using (VB2008Express)
Private Function fileToStrings2(ByVal filNamn As String) As boolean
Dim input As String
Dim objReader As New System.IO.StreamReader(filNamn)
Do While objReader.Peek() <> -1
input = objReader.ReadLine() ' <- Offending line of code
msgbox(input)
Loop
return True
End Function
The rows I'm trying to read
Quote
#2008-11-07 10:55:41#,"First line of text with no special characters"
#2008-11-07 10:57:24#,"Second line with (åäöÅÄÖ) special characters"
#2008-11-07 10:57:24#,"Second line with (åäöÅÄÖ) special characters"
Regards
/Jens
PS: I did take some functionality out of the code to clarify and get my point across.
This post has been edited by jens: 18 November 2008 - 03:07 PM

New Topic/Question
Reply




MultiQuote




|