Having trouble geting the encoding right in my silverlight application. I need support for western europe letters like æ,ø,å,â and so(Latin1??). But I can't get it right. What should be instead of SOMEENCODINGHERE? did try Encoding enc = Encoding.GetEncoding("Latin1"); but no names I used as param was recognized =( . If I use Encoding.Unicode tr.ReadLine() reads the whole file and convert it to Chinese for some reason.
private Dictionary<int, string> InitDictionary()
{
var d = new Dictionary<int, string>();
var sri = App.GetResourceStream(new Uri(fileDic, UriKind.Relative));
using (TextReader tr = new StreamReader(sri.Stream, Encoding.SOMEENCODINGHERE))
{
int i = 0;
string line;
while ((line = tr.ReadLine()) != null)
{
d.Add(i++, line);
}
}
return d;
}