solemnwarning / rehex

Reverse Engineers' Hex Editor
https://rehex.solemnwarning.net/
GNU General Public License v2.0
2.3k stars 113 forks source link

0x0D bytes are not pasted #192

Closed Ritterbrater closed 10 months ago

Ritterbrater commented 1 year ago

Hi,

nice project! I was looking for a longer time for a great open source hex editor. Now I found one. But I have an unkind issue: Version: 0.5.4 and earlier OS: Win 10 x64 Description:

Expected behavior:

I hope I did not oversee any configuration (like the fixed number of bytes per line) ;)

Before somebody asks: Why not using a text editor? - Large file with mixed binary and text data.

Thank you!

solemnwarning commented 1 year ago

That's kinda weird... where exactly are you copying to/from?

If you copy/paste in the hex area, you should get a string of hex bytes and in the text area, a string of any printable characters in the selection... 0x0D 0x0A seem to copy/paste fine for me in both.

Ritterbrater commented 1 year ago

Ah ok, I see a different behaviour, depending on copy/paste from the text hex view and from the text representation view. Details:

solemnwarning commented 10 months ago

I've done some thinking on this, and I don't think there's a good way to fix it.

I considered implementing a composite data type for when "text" is copied into the clipboard, which would allow for exporting platform-native text to other applications, but also the raw data for pasting back into rehex - this would fix the case of preserving line endings when copying/pasting within rehex, but would create other subtle edge cases where text encodings differ, or characters on the source side cannot be represented on the destination side.

So I think allowing the line endings to change when copying/pasting text is the lesser evil, which some other tools also do: https://github.com/Microsoft/vscode/issues/53820#issuecomment-420581522