I have got problem with getting string from the file via linq.
My file is:
LANG_FORM="nnd documents acceptance"
%>
Response.Write "<SCRIPT LANGUAGE=javascript>alert('" & LN("KtśćóŻ") & "');</SCRIPT>"
it is part of asp file but now it is doesn’t matter.
I have to get value in LN function.
I write linq synatx like:
var LN = from place in File.ReadAllLines(item.file)
where Regex.IsMatch(place, pattern)
select new { place };
In debug view i have non properly output:
{ place = Response.Write "<SCRIPT LANGUAGE=javascript>alert('" & LN("Kt���") & "');</SCRIPT>" }
My question is, how prepare linq syntax to get output properly (they are polish letters)?
I think encoding is wrong.
Try File.ReadAllLines(String, Encoding).
You can use desired encoding, not only
Encoding.UTF8.