coding "\x00".force_encoding('binary') or ["\x00"].pack('a*') is a hassle, is there a chance to have special percent literal for it?
i.e: %b"\x00" would return binary string. (note, signle-character \x00 there is accidental, the idea is force any string from script encoding to binary)
or, more general suggestion:
allow percent literal with any [a-z] character, move all logic to user-level and allow it to be redefinable:
I think runtime-customisable percent-literal strings are a bit of a hard ask, since things like %w, %r, %x are so tightly integrated with the parser itself.
Even the question of when to stop consuming (nested brackets? escape characters? interpolation??) means there will be messy and confusing edge-cases.
I'm not against the idea per se, I just think it's not workable in the Ruby we have today.