Talk:Hex dump

From Rosetta Code

Better input/output requirements

The current example (and required input) being encoded in UTF-16 was not intended to be a significant part of the task, but just a small sample of bytes, some of which are outside the ASCII range, including some non-printing ASCII. As an output requirement, perhaps the first 128 bytes of the Rosetta Code logo ("RosettaCodeTitle.ico") would be better? Or the first X bytes of the task implementation's source code?

The given example is better than either, all {{out}} should be the same or easily comparable. --Petelomax (talk) 13:45, 30 October 2023 (UTC)

For what it's worth, my editor doesn't do UTF-16 either. I used something like the following Python code to generate a sample file.

s = "Rosetta Code is a programming chrestomathy site \U0001F600."
with open("example_utf16.txt", "wb") as of

--Jgrprior (talk) 06:27, 30 October 2023 (UTC)

Nevermind (the deleted remarks), I just found a neater way for the Phix entry. --Petelomax (talk) 14:54, 30 October 2023 (UTC)
👍 Somehow, in my head, I managed to combine your original comments and PureFox's, and came up with something that was mostly nonsense. --Jgrprior (talk) 16:50, 31 October 2023 (UTC)
Although UTF-16 is an encoding you'd normally associate with Windows, I was pleasantly surprised when gedit (Ubuntu's equivalent of notepad) supported it. So no subsequent conversions were necessary :) --PureFox (talk) 16:17, 31 October 2023 (UTC)