Encoding problem??
-
Hi guys! having a bit of a problem.. im picking upp value from file rowes, and i live in sweden so we use the characters å,ä,ö a lot. so i want to replace the å ä ö with something else, because when i return the row in a listview the ö are like ? or something like that... =( i have tryade to save in diffirent encoding.. nothing works! anyone with the same problem as me?? i pick upp info from rowes like this: String row5 = File.ReadAllLines(file)[row]; string[] tecken = row5.Split(';'); string person = tecken[21]; anyone with good suggestions?? thanks!! peace! :doh:
-
Hi guys! having a bit of a problem.. im picking upp value from file rowes, and i live in sweden so we use the characters å,ä,ö a lot. so i want to replace the å ä ö with something else, because when i return the row in a listview the ö are like ? or something like that... =( i have tryade to save in diffirent encoding.. nothing works! anyone with the same problem as me?? i pick upp info from rowes like this: String row5 = File.ReadAllLines(file)[row]; string[] tecken = row5.Split(';'); string person = tecken[21]; anyone with good suggestions?? thanks!! peace! :doh:
-
UTF-8 should support Swedish characters. Are they not storing in your file correctly, or is it the listView not displaying them correctly?
-
i think its the listview hwo doesn´t display them correclty. beacouse i have tryade every encoding.. are i changing the ecoding throught advanced save options???? Thanks
I've tested the listView and it displays them fine. Are you specifying the encoding to use when reading your file as I think that's where your problem is?
System.Text.Encoding swedishEncoding;
swedishEncoding = System.Text.Encoding.UTF8;
//Or if that doesn't work;
swedishEncoding = System.Text.Encoding.GetEncoding(437);//To read
System.IO.StreamReader swedishReader = new System.IO.StreamReader("myPathHere", swedishEncoding, false);