KaptinKrunch wrote:
changing the code to the listing below resolved my issue.
That means that the file is not at all Unicode, but ANSI.
KaptinKrunch wrote:
bytesRead = fStream.Read(buffer, 0, buffer.Length);
Ouch. You read from the file, but you ignore the result. The Read method doesn't have to read as much data as you request. You have to loop until all data is read, or the method return zero. The easiest is of course to just replace all that code with: string text = File.ReadAllText(sourceFiles[i].ToString(), Encoding.Default);
Despite everything, the person most likely to be fooling you next is yourself.