Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
cyq1162 committed Sep 18, 2018
1 parent 667a367 commit 3096393
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Tool/IOHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ internal static bool Save(string fileName, string text, bool isAppend, bool writ
else if (File.Exists(fileName))
{
TextEncodingDetect detect = new TextEncodingDetect();
encode = detect.GetEncoding(File.ReadAllBytes(fileName), encode);
Encoding detectEncode = detect.GetEncoding(File.ReadAllBytes(fileName), encode);
if (detectEncode != Encoding.ASCII)
{
encode = detectEncode;
}
cache.Set(key, encode, 60);
}
lock (GetLockObj(fileName.Length))
Expand Down Expand Up @@ -248,7 +252,7 @@ internal static string BytesToText(byte[] buff, Encoding encoding)
}
return encoding.GetString(buff);


}

}
Expand Down

0 comments on commit 3096393

Please sign in to comment.