Ah sorry, the moment I sent the question, I figured out the answer : this is just a side effect of the final (pack ..).
When using (str ...) I get what I want: : (str (make (while Y (link (char (hex (pack (cut 2 'Y)] -> "\"#\" \"#\" \"\^B\" NIL NIL NIL \"\^A\" NIL \"\^A\" NIL \"\^O\" NIL NIL NIL NIL NIL NIL NIL \"2\" \"0\" \"2\" \"4\" \"-\" \"0\" \"2\" \"-\" \"0\" \"9\" \"1\" \"0\" \"-\" \"5\" \"4\" \"-\" \"0\" \"5\" \" \" \" \" NIL NIL NIL NIL NIL NIL NIL NIL \"$\" \"$\"" although somehow I still think it would be fine to have 'pack that prints the NIL too, in this special case: : (pack (make (while Y (link (char (hex (pack (cut 2 'Y)] -> "##^B^A^A^O2024-02-0910-54-05 $$" Am Mo., 12. Feb. 2024 um 23:25 Uhr schrieb Thorsten Jolitz < tjol...@gmail.com>: > Hello List, > it's been some time .. ;-) > > I'm playing around a bit with hex<->ascii conversion in PicoLisp, and I > have the problem that (char 0) = NIL > > (hex "00") > -> 0 > : (char (hex "00")) > -> NIL > > and disappears from the resulting ascii string. > > : (setq X > "232302000000010001000F00000000000000323032342D30322D303931302D35342D3035202000000000000000002424") > : (setq Y (chop X)) > : (pack (make (while Y (link (char (hex (pack (cut 2 'Y)] > -> "##^B^A^A^O2024-02-0910-54-05 $$" > > So how would it be possible to convert the ascii string back to the > original hex string, when all the "00" are gone in the ascii > representation? Shouldn't the (char 0) representation print to something > like ^N or so too, like (char 1), (char 2) etc? > > When I try this online converter, the "00" are maintained as blanks: > Hex to ASCII Text String Converter (rapidtables.com) > <https://www.rapidtables.com/convert/number/hex-to-ascii.html> > [image: image.png] > > and here is another representation that seems to enable the hex -> ascii > -> hex conversion, getting exactly the same hex string in the end as in the > beginning (not exactly the same conversion as above! just an example how it > might look) : > [image: image.png] > Cheers > Thorsten >