I'm reading the documentation of 'pack'. I cannot understand this:
unpack("a3/A A*", "007 Bond J ") gives (" Bond", "J")
unpack("a3 x2 /A A*", "007: Bond, J.") gives ("Bond, J", ".")
"You write "/"sequence-item and the repeat count is obtained by popping off the last element from the stack. The sequence-item must not have a repeat count.
If sequence-item refers to a string type ("A", "a", or "Z"), the length-item is the string length, not the number of strings."
What does it all mean? I think when the doc talks about popping from the stack, that only applies to the numeric data. Or something. So yeah, how does that work?
Also:
"Pack and unpack can operate in two modes: character mode ("C0" mode) where the packed string is processed per character, and UTF-8 mode ("U0" mode) where the packed string is processed in its UTF-8-encoded Unicode form on a byte-by-byte basis."
What's that all about? It means that with U0 pack treats the string as C-style bytearray? Or what?