Browse Source

HexEditor: Replace more control characters with dots.

pull/32/merge
Daniel Grunwald 12 years ago
parent
commit
6d38e5fdfd
  1. 2
      src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs
  2. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Rope.cs

2
src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs

@ -1076,7 +1076,7 @@ namespace HexEditor
string GetText(byte[] bytes) string GetText(byte[] bytes)
{ {
for (int i = 0; i < bytes.Length; i++) { for (int i = 0; i < bytes.Length; i++) {
if (bytes[i] < 32) bytes[i] = 46; if (bytes[i] < 32 || (bytes[i] >= 0x80 && bytes[i] < 0xA0)) bytes[i] = 46;
} }
string text = this.Encoding.GetString(bytes); string text = this.Encoding.GetString(bytes);

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Rope.cs

@ -786,7 +786,7 @@ namespace ICSharpCode.AvalonEdit.Utils
public T[] ToArray() public T[] ToArray()
{ {
T[] arr = new T[this.Length]; T[] arr = new T[this.Length];
CopyTo(arr, 0); this.root.CopyTo(0, arr, 0, arr.Length);
return arr; return arr;
} }

Loading…
Cancel
Save