Hi,
I have a ListView which represents a shopping list and contains a number of items. I also have an <Export> button which, when clicked, writes all the items in the listview to a CSV file.
My problem is that when I test this on a Spanish Win2000 PC the displayed text in the list is output incorrectly.
e.g.
"Protección de carcasa"
is output as
"Protección de carcasa"
Does anybody have any suggestions?
VB Code:
Private Sub cmdExport_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles cmdExport.Click 'Export the Shopping List in CSV format. Dim str As String Dim int As Integer If SaveFileDialog1.ShowDialog() = DialogResult.OK Then Dim strFile As String = SaveFileDialog1.FileName If strFile <> "" Then Dim swExport As StreamWriter Try Dim utf8 As New System.Text.UTF8Encoding() swExport = New StreamWriter(New FileStream(strFile, _ FileMode.OpenOrCreate), utf8) '"ProductCode,Description,LoopA,LoopB,LoopC,LoopD,Total" swExport.WriteLine(GetText("exportFileHeader")) Dim ShoppingListItem As ListViewItem For Each ShoppingListItem In lvwShoppingList.Items str = "" For int = 0 To 6 str &= ShoppingListItem.SubItems(int).Text & "," Next int 'Remove the trailing "," from the string. str = Mid(str, 1, str.Length - 1) swExport.WriteLine(str) Next ShoppingListItem Finally swExport.Close() End Try End If End If End Sub




Reply With Quote