If a string starts with a sequence that requires $'' quoting followed by a \' and then another charactrer requiring $'' quoting, the '$' at the start of the quoted string ends up missing:
$ env printf '%q\n' $'\1\'\2' '\001'\'''$'\002'
If a string starts with a sequence that requires $'' quoting followed by a \' and then another charactrer requiring $'' quoting, the '$' at the start of the quoted string ends up missing:
$ env printf '%q\n' $'\1\'\2' '\001'\'''$'\002'