Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not showing full file content when there is a NULL character in the middle of the file #216

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified src/Notepads/Strings/tr-TR/Resources.resw
100755 → 100644
Empty file.
Empty file modified src/Notepads/Strings/tr-TR/Settings.resw
100755 → 100644
Empty file.
6 changes: 5 additions & 1 deletion src/Notepads/Utilities/FileSystemUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ public static async Task<TextFile> ReadFile(StorageFile file, bool ignoreFileSiz
reader.Peek();
if (encoding == null) encoding = reader.CurrentEncoding;
text = reader.ReadToEnd();

// Removing null characters, so that RichEditBox won't stop reading characters in the middle of the file.
text = text.Replace("\0", "");

reader.Close();
}

Expand Down Expand Up @@ -394,7 +398,7 @@ public static async Task<bool> TryAddOrReplaceTokenInFutureAccessList(string tok
catch (Exception ex)
{
LoggingService.LogError($"Failed to add file [{file.Path}] to future access list: {ex.Message}");
Analytics.TrackEvent("FailedToAddTokenInFutureAccessList",
Analytics.TrackEvent("FailedToAddTokenInFutureAccessList",
new Dictionary<string, string>()
{
{ "ItemCount", GetFutureAccessListItemCount().ToString() },
Expand Down