Skip to content

Commit

Permalink
Allow manually viewing text longer than the limit
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Oct 6, 2024
1 parent 0d078c5 commit c8de620
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ void SaveDataToFile(object sender, EventArgs e)
void DisplayDataAsAscii(object sender, EventArgs e)
{
var data = (byte[])value;
SetValueForDisplay(Encoding.ASCII.GetString(data).Replace("\0", "\\0", StringComparison.InvariantCulture) );
SetValueForDisplay(Encoding.ASCII.GetString(data).Replace("\0", "\\0", StringComparison.Ordinal));
}

void DisplayDataAsUTF8(object sender, EventArgs e)
{
var data = (byte[])value;
SetValueForDisplay(Encoding.UTF8.GetString(data).Replace("\0", "\\0", StringComparison.InvariantCulture));
SetValueForDisplay(Encoding.UTF8.GetString(data).Replace("\0", "\\0", StringComparison.Ordinal));
}

void DisplayDataAsHexadecimal(object sender, EventArgs e)
Expand Down Expand Up @@ -482,13 +482,9 @@ void InitializeContextMenu()
}

ContextMenuItems.Add( new ToolStripMenuItem( "&Protobuf", null, DisplayDataAsProtobuf ).AsRadioCheck() );

if ( data.Length <= MaxDataLengthForDisplay )
{
ContextMenuItems.Add( new ToolStripMenuItem( "&ASCII", null, DisplayDataAsAscii ).AsRadioCheck() );
ContextMenuItems.Add( new ToolStripMenuItem( "&UTF-8", null, DisplayDataAsUTF8 ).AsRadioCheck() );
ContextMenuItems.Add( new ToolStripMenuItem( "&Hexadecimal", null, DisplayDataAsHexadecimal ) { Checked = true }.AsRadioCheck() );
}
ContextMenuItems.Add( new ToolStripMenuItem( "&ASCII", null, DisplayDataAsAscii ).AsRadioCheck() );
ContextMenuItems.Add( new ToolStripMenuItem( "&UTF-8", null, DisplayDataAsUTF8 ).AsRadioCheck() );
ContextMenuItems.Add( new ToolStripMenuItem( "&Hexadecimal", null, DisplayDataAsHexadecimal ) { Checked = true }.AsRadioCheck() );
}
}

Expand Down

0 comments on commit c8de620

Please sign in to comment.