I have data that I want displayed in a listview.
Problem is when I read from a file with System.Text.Encoding.GetEncoding("Windows-1252"),
it shows up in listview with Zoë instead of Zoë as it should.
How can I make my listview code to show the correct diacritics in the view?

This is the part of the code where it is inserted:

        objStreamReader = New StreamReader(strStorageFile, System.Text.Encoding.GetEncoding("Windows-1252"))
        If strParam2 = "" Then
            Do While objStreamReader.Peek() > 0
                strKarLine = objStreamReader.ReadLine()
                strKars = strKarLine.Split(";")
                If strKars(intCate1) = strParam1 Then
                    insert = New ListViewItem(strKars)
                    ListView1.Items.Add(insert)
                End If
            Loop
        Else
            Do While objStreamReader.Peek() > 0
                strKarLine = objStreamReader.ReadLine()
                strKars = strKarLine.Split(";")
                If (strKars(intCate1) = strParam1 AndAlso strKars(intCate2) = strParam2) Then
                    insert = New ListViewItem(strKars)
                    ListView1.Items.Add(insert)
                End If
            Loop
        End If

The file you're trying to load is UTF-8 encoded. Try using UTF8Encoding instead.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.